AttributeType OBJECT_CLASS = schemaManager.lookupAttributeTypeRegistry( "objectClass" );
AttributeType CN_AT = schemaManager.lookupAttributeTypeRegistry( "cn" );
// this should pass
DN name = new DN( "uid=akarasulu,ou=users,dc=example,dc=com" );
ModificationOperation mod = ModificationOperation.REPLACE_ATTRIBUTE;
SchemaChecker.preventStructuralClassRemovalOnModifyReplace( schemaManager, name, mod, new DefaultServerAttribute( "cn", CN_AT ) );
// this should succeed since person is still in replaced set and is structural
ServerAttribute objectClassesReplaced = new DefaultServerAttribute( "objectClass", OBJECT_CLASS );
objectClassesReplaced.add( "top" );