InputTextReader { public boolean eof() { return _content.length() <= _index; } InputTextReader(String content); char read(); String peek(int numberChars); char peekChar(int offset); boolean canReadChars(int numberChars); boolean eof(); int getPosition(); int getBacktrackedCount(); void seek(int position); void goBack();  }
@Test public void testEOF() { InputTextReader reader = new InputTextReader(CONTENT); for (int i = 0; i < CONTENT.length() - 1; i++) { reader.read(); } Assert.assertFalse(reader.eof()); reader.read(); Assert.assertTrue(reader.eof()); }