### Question:
HeaderParser { protected static int readToString(byte[] header, int off) { int limit = header.length - 3; int i = off; while(i < limit) { i = readAfterGap(header, i, 2); if(isStringAt(header, i-2)) { return i-2; } i++; } return -1; }  static CustomHeader parse(File map); static CustomHeader parse(byte[] map); static CustomHeader parse(ByteSource source); static int findEndOfHeader(ByteSource source);  }### Answer:
@Test public void testReadToString() throws Exception { int expected = 2; int actual = HeaderParser.readToString(inputString, 0); assertEquals(expected, actual); }
@Test public void testReadToString2() throws Exception { int expected = 25; int actual = HeaderParser.readToString(inputString, 7); assertEquals(expected, actual); }