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