### Question:
CGT { public int getEntriesRead() { return entriesRead; } 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 testGetEntriesRead() throws Exception { CGT cgt = new CGT(); cgt.open(new ByteArrayInputStream(toByteArray(HEADER, SAMPLE_BYTES))); assertEquals("shouldn't have entries that have been read", 0, cgt.getEntriesRead()); cgt.getNextRecord(); assertEquals("shouldn't have entries that have been read", 0, cgt.getEntriesRead()); cgt.retrieveByte(); assertEquals("wrong number of entries read", 1, cgt.getEntriesRead()); cgt.retrieveByte(); assertEquals("wrong number of entries read", 2, cgt.getEntriesRead()); cgt.retrieveByte(); assertEquals("wrong number of entries read", 3, cgt.getEntriesRead()); try { cgt.retrieveByte(); fail("didn't expect data"); } catch (IOException e) { } assertEquals("wrong number of entries read", 3, cgt.getEntriesRead()); }