@Test
public void testFindNthByte() {

  byte[] data = "Hello, world!".getBytes();
  assertEquals("Did not find 2nd occurrence of character 'l'", 3,
      UTF8ByteArrayUtils.findNthByte(data, 0, data.length, (byte) 'l', 2));
  assertEquals("4th occurrence of character 'l' does not exist", -1,
      UTF8ByteArrayUtils.findNthByte(data, 0, data.length, (byte) 'l', 4));
  assertEquals("Did not find 3rd occurrence of character 'l'", 10,
      UTF8ByteArrayUtils.findNthByte(data, (byte) 'l', 3));
}