### Question:
MavibotIndex extends AbstractIndex<K, String> { public void setWkDirPath( URI wkDirPath ) { protect( "wkDirPath" ); this.wkDirPath = new File( wkDirPath ); } MavibotIndex( String attributeId, boolean withReverse ); void init( SchemaManager schemaManager, AttributeType attributeType ); void setRecordManager( RecordManager rm ); 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 ); @Override 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 ); @Override boolean reverse( PartitionTxn partitionTxn, String id ); @Override boolean reverse( PartitionTxn partitionTxn, String id, K attrVal ); @Override synchronized void close( PartitionTxn partitionTxn ); synchronized void sync(); @Override boolean isDupsEnabled(); String toString(); static final String FORWARD_BTREE; static final String REVERSE_BTREE; }### Answer:
@Test public void testAttributeId() throws Exception { MavibotIndex<Object> MavibotIndex1 = new MavibotIndex<Object>( "foo", false ); assertEquals( "foo", MavibotIndex1.getAttributeId() ); MavibotIndex<Object> MavibotIndex2 = new MavibotIndex<Object>( "bar", false ); assertEquals( "bar", MavibotIndex2.getAttributeId() ); initIndex(); try { idx.setAttributeId( "foo" ); fail( "Should not be able to set attributeId after initialization." ); } catch ( Exception e ) { } assertEquals( "ou", idx.getAttributeId() ); destroyIndex(); MavibotIndex<String> index = new MavibotIndex<String>( "foo", false ); index.setWkDirPath( dbFileDir.toURI() ); initIndex( index ); assertEquals( "foo", idx.getAttributeId() ); }