UnbindOperationExecutor implements
        CompensatingTransactionOperationExecutor { public void rollback() { try { ldapOperations.rename(temporaryDn, originalDn); } catch (Exception e) { log.warn("Filed to rollback unbind operation, temporaryDn: " + temporaryDn + "; originalDn: " + originalDn); } } UnbindOperationExecutor(LdapOperations ldapOperations,
            Name originalDn, Name temporaryDn); void rollback(); void commit(); void performOperation();  }
@Test public void testRollback() { LdapName expectedOldName = LdapUtils.newLdapName("cn=oldDn"); LdapName expectedTempName = LdapUtils.newLdapName("cn=newDn"); UnbindOperationExecutor tested = new UnbindOperationExecutor( ldapOperationsMock, expectedOldName, expectedTempName); tested.rollback(); verify(ldapOperationsMock).rename(expectedTempName, expectedOldName); }