### Question:
CGT { public int getEntryCount() { return entryCount; } 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 testGetEntryCount() throws Exception { CGT cgt = new CGT(); cgt.open(new ByteArrayInputStream(toByteArray(HEADER, SAMPLE_BYTES))); assertEquals("shouldn't have entries to process", 0, cgt.getEntryCount()); cgt.getNextRecord(); assertEquals("wrong number of entries", 3, cgt.getEntryCount()); }