public static void removeAllByDN(Set<String> originalSet,Collection<String> toDelete){
  Set<DN> setDNs=toDNs(toDelete);
  for (Iterator<String> iter=originalSet.iterator(); iter.hasNext(); ) {
    String strDN=iter.next();
    DN dn=DN.valueOf(strDN);
    if (containsDN(setDNs,dn)) {
      iter.remove();
    }
  }
}

public static void removeAllByDN ( Set < String > originalSet , Collection < String > toDelete ) { Set < DN > setDNs = toDNs ( toDelete ) ; for ( Iterator < String > iter = originalSet . iterator ( ) ; iter . hasNext ( ) ; ) { String strDN = iter . next ( ) ; DN dn = DN . valueOf ( strDN ) ; if ( containsDN ( setDNs , dn ) ) { iter . remove ( ) ; } } }
removes all matching entries from a set if entries exist in another set . entries in the sets are ldap entries .
