### Question:
JdbmIndex extends AbstractIndex<K, String> { public void setWkDirPath( URI wkDirPath ) { protect( "wkDirPath" ); this.wkDirPath = new File( wkDirPath ); } 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 testAttributeId() throws Exception { JdbmIndex<Object> jdbmIndex1 = new JdbmIndex<Object>( "foo", false ); assertEquals( "foo", jdbmIndex1.getAttributeId() ); JdbmIndex<Object> jdbmIndex2 = new JdbmIndex<Object>( "bar", false ); assertEquals( "bar", jdbmIndex2.getAttributeId() ); initIndex(); try { idx.setAttributeId( "foo" ); fail( "Should not be able to set attributeId after initialization." ); } catch ( Exception e ) { } assertEquals( "ou", idx.getAttributeId() ); destroyIndex(); JdbmIndex<String> index = new JdbmIndex<String>( "foo", false ); index.setWkDirPath( tmpIndexFile.toURI() ); initIndex( index ); assertEquals( "foo", idx.getAttributeId() ); }