A man accused of murder testified in his own defense as part of an immunity hearing.