{
BasicAttributes attrs;
Set indexedAttrs;
Set pcfgs = new HashSet();
MutableDirectoryPartitionConfiguration pcfg;
// Add partition 'testing'
pcfg = new MutableDirectoryPartitionConfiguration();
pcfg.setName( "testing" );
pcfg.setSuffix( "ou=testing" );
indexedAttrs = new HashSet();
indexedAttrs.add( "ou" );
indexedAttrs.add( "objectClass" );
pcfg.setIndexedAttributes( indexedAttrs );
attrs = new BasicAttributes( true );
BasicAttribute attr = new BasicAttribute( "objectClass" );
attr.add( "top" );
attr.add( "organizationalUnit" );
attr.add( "extensibleObject" );
attrs.put( attr );
attr = new BasicAttribute( "ou" );
attr.add( "testing" );
attrs.put( attr );
pcfg.setContextEntry( attrs );
pcfgs.add( pcfg );
// Add partition 'example'
pcfg = new MutableDirectoryPartitionConfiguration();
pcfg.setName( "example" );
pcfg.setSuffix( "dc=example" );
indexedAttrs = new HashSet();
indexedAttrs.add( "ou" );
indexedAttrs.add( "dc" );
indexedAttrs.add( "objectClass" );
pcfg.setIndexedAttributes( indexedAttrs );
attrs = new BasicAttributes( true );
attr = new BasicAttribute( "objectClass" );
attr.add( "top" );
attr.add( "domain" );
attr.add( "extensibleObject" );
attrs.put( attr );
attr = new BasicAttribute( "dc" );
attr.add( "example" );
attrs.put( attr );
pcfg.setContextEntry( attrs );
pcfgs.add( pcfg );
// Add partition 'MixedCase'
pcfg = new MutableDirectoryPartitionConfiguration();
pcfg.setName( "mixedcase" );
pcfg.setSuffix( "dc=MixedCase" );
indexedAttrs = new HashSet();
indexedAttrs.add( "dc" );
indexedAttrs.add( "objectClass" );
pcfg.setIndexedAttributes( indexedAttrs );
attrs = new BasicAttributes( true );
attr = new BasicAttribute( "objectClass" );
attr.add( "top" );
attr.add( "domain" );
attr.add( "extensibleObject" );
attrs.put( attr );
attr = new BasicAttribute( "dc" );
attr.add( "MixedCase" );
attrs.put( attr );
pcfg.setContextEntry( attrs );
pcfgs.add( pcfg );
configuration.setContextPartitionConfigurations( pcfgs );