Dn dn = new Dn( schemaManager, "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );
Attribute attrib = new DefaultAttribute( SchemaConstants.SN_AT, schemaManager
.lookupAttributeTypeRegistry( SchemaConstants.SN_AT_OID ) );
Modification add = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, attrib );
Entry lookedup = partition.lookup( partition.getEntryId( dn ) );
assertNotNull( lookedup.get( "sn" ).get() );
lookedup = partition.modify( dn, add );
assertNull( lookedup.get( "sn" ) );
// add an entry for the sake of testing the remove operation
lookedup = partition.modify( dn, new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, SN_AT, "JWalker" ) );
assertNotNull( lookedup.get( "sn" ) );
lookedup = partition.modify( dn, new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, SN_AT ) );
assertNull( lookedup.get( "sn" ) );
}