### Question:
JdbmIndex extends AbstractIndex<K, String> { public long count( PartitionTxn partitionTxn ) throws LdapException { return forward.count( partitionTxn ); } JdbmIndex( String attributeId, boolean withReverse ); void init( RecordManager recMan, SchemaManager schemaManager, AttributeType attributeType ); int getNumDupLimit(); void setNumDupLimit( int numDupLimit ); void setWkDirPath( URI wkDirPath ); URI getWkDirPath(); long count( PartitionTxn partitionTxn ); long count( PartitionTxn partitionTxn, K attrVal ); @Override long greaterThanCount( PartitionTxn partitionTxn, K attrVal ); @Override long lessThanCount( PartitionTxn partitionTxn, K attrVal ); String forwardLookup( PartitionTxn partitionTxn, K attrVal ); K reverseLookup( PartitionTxn partitionTxn, String id ); synchronized void add( PartitionTxn partitionTxn,  K attrVal, String id ); synchronized void drop( PartitionTxn partitionTxn, K attrVal, String id ); void drop( PartitionTxn partitionTxn, String entryId ); @SuppressWarnings("unchecked") Cursor<IndexEntry<K, String>> forwardCursor( PartitionTxn partitionTxn ); Cursor<IndexEntry<K, String>> forwardCursor( PartitionTxn partitionTxn, K key ); @Override Cursor<K> reverseValueCursor( PartitionTxn partitionTxn, String id ); Cursor<String> forwardValueCursor( PartitionTxn partitionTxn, K key ); boolean forward( PartitionTxn partitionTxn, K attrVal ); boolean forward( PartitionTxn partitionTxn, K attrVal, String id ); boolean reverse( PartitionTxn partitionTxn, String id ); boolean reverse( PartitionTxn partitionTxn, String id, K attrVal ); @Override synchronized void close( PartitionTxn partitionTxn ); @Override boolean isDupsEnabled(); String toString(); static final int DEFAULT_DUPLICATE_LIMIT; static final String FORWARD_BTREE; static final String REVERSE_BTREE; }### Answer:
@Test public void testCount() throws Exception { initIndex(); assertEquals( 0, idx.count( partitionTxn ) ); idx.add( partitionTxn, "foo", Strings.getUUID( 1234L ) ); assertEquals( 1, idx.count( partitionTxn ) ); idx.add( partitionTxn, "foo", Strings.getUUID( 333L ) ); assertEquals( 2, idx.count( partitionTxn ) ); idx.add( partitionTxn, "bar", Strings.getUUID( 555L ) ); assertEquals( 3, idx.count( partitionTxn ) ); }