### Question:
LdifRevertor { public static LdifEntry reverseAdd( Dn dn ) { LdifEntry entry = new LdifEntry(); entry.setChangeType( ChangeType.Delete ); entry.setDn( dn ); return entry; } private  LdifRevertor(); static LdifEntry reverseAdd( Dn dn ); static LdifEntry reverseDel( Dn dn, Entry deletedEntry ); static LdifEntry reverseModify( Dn dn, List<Modification> forwardModifications, Entry modifiedEntry ); static LdifEntry reverseMove( Dn newSuperiorDn, Dn modifiedDn ); static List<LdifEntry> reverseRename( Entry entry, Rdn newRdn, boolean deleteOldRdn ); static List<LdifEntry> reverseMoveAndRename( Entry entry, Dn newSuperior, Rdn newRdn, boolean deleteOldRdn ); static final boolean DELETE_OLD_RDN; static final boolean KEEP_OLD_RDN; }### Answer:
@Test public void testReverseAdd() throws LdapInvalidDnException { Dn dn = new Dn( "dc=apache, dc=com" ); LdifEntry reversed = LdifRevertor.reverseAdd( dn ); assertNotNull( reversed ); assertEquals( dn.getName(), reversed.getDn().getName() ); assertEquals( ChangeType.Delete, reversed.getChangeType() ); assertNull( reversed.getEntry() ); }
@Test public void testReverseAddBase64DN() throws LdapException { Dn dn = new Dn( "dc=Emmanuel L\u00c9charny" ); LdifEntry reversed = LdifRevertor.reverseAdd( dn ); assertNotNull( reversed ); assertEquals( dn.getName(), reversed.getDn().getName() ); assertEquals( ChangeType.Delete, reversed.getChangeType() ); assertNull( reversed.getEntry() ); }