IndexV1 implements Index { @Override public int count() { return entries.remaining() / IndexEntryV1.SIZE; } IndexV1(Buffer entries); @Override Set<UUID> getUUIDs(); @Override int findEntry(long msb, long lsb); @Override int size(); @Override int count(); @Override IndexEntryV1 entry(int i);  }
@Test public void testCount() throws Exception { Buffer buffer = Buffer.allocate(2 * IndexEntryV1.SIZE); buffer.duplicate() .putLong(1).putLong(2).putInt(3).putInt(4).putInt(5) .putLong(6).putLong(7).putInt(8).putInt(9).putInt(10); assertEquals(2, new IndexV1(buffer).count()); }