Arizona sheriff testifies in contempt hearing