### Question:
CGT { public boolean atEOF() { return eofReached; } CGT(); Entry retrieveEntry(); boolean atEOF(); void close(); boolean isRecordComplete(); int getEntryCount(); int getEntriesRead(); String getHeader(); boolean getNextRecord(); void open(File file); void open(InputStream input); boolean retrieveBoolean(); int retrieveByte(); int retrieveInteger(); String retrieveString(); static final int RECORD_CONTENT_MULTI; }### Answer:
@Test public void testAtEOF() throws Exception { CGT cgt = new CGT(); assertTrue(cgt.atEOF()); cgt.open(new ByteArrayInputStream(new byte[] {})); assertTrue("empty (no header, etc.) returns true", cgt.atEOF()); cgt.open(new ByteArrayInputStream(toByteArray(HEADER))); cgt.close(); assertTrue("closed stream returns true", cgt.atEOF()); cgt.open(new ByteArrayInputStream(toByteArray(HEADER))); assertFalse("header, but nothing else read returns false", cgt.atEOF()); cgt.getNextRecord(); assertTrue("no more data returns true", cgt.atEOF()); }