Parser { protected byte peek() { if (pointer < array.length) { return array[pointer]; } else { throw new ParserException("Cannot peek, would peek over the end ot the array"); } } Parser(int startposition, byte[] array); int getPointer(); void setPointer(int pointer); int getStartPoint(); abstract T parse();  }
@Test public void testPeek() { parser.parseByteArrayField(4); assertEquals(4, parser.peek()); }