### Question:
ByteUtilities { static int indexOf(byte[] bytes, int byteLength, byte[] marker) { int index = -1; int length = byteLength - (marker.length - 1); for (int b = 0; b < length; b++) { boolean equals = true; for (int m = 0; m < marker.length; m++) { if (bytes[b + m] != marker[m]) { equals = false; break; } } if (equals) { return b; } } return index; } private  ByteUtilities(); static int readNBytes(InputStream in, OutputStream out, int byteCount); static boolean readUntilInclusive(PushbackInputStream in, OutputStream out, byte[] marker);  }### Answer:
@Test public void testIndexOf() { Assert.assertEquals(2, ByteUtilities.indexOf(new byte[] { 1, 2, 3, 4, 5 }, 5, new byte[] { 3, 4 })); Assert.assertEquals(3, ByteUtilities.indexOf(new byte[] { 1, 2, 3, 4, 5 }, 5, new byte[] { 4, 5 })); Assert.assertEquals(4, ByteUtilities.indexOf(new byte[] { 1, 2, 3, 4, 5 }, 5, new byte[] { 5 })); Assert.assertEquals(-1, ByteUtilities.indexOf(new byte[] { 1, 2, 3, 4, 5 }, 5, new byte[] { 5, 6 })); }