code: public boolean equalsAllBut(DirRecord that, String[] attrIDs) throws NamingException {
      if (attrIDs == null)
        throw new NamingException("DirectoryRecord: null attrID list");
  
      if (!dnEquals(that)) {
        return false;
      }
  
      int n = attrIDs.length;
  
      if (n == 0) return true;
  
      Attributes thisAttrs = getAttributes();
      Attributes thatAttrs = that.getAttributes();
  
      if (thisAttrs == null) {
        if (thatAttrs == null) return true;
        return false;
      }
  
      if (thatAttrs == null) {
        return false;
      }
  
      /** We need to ensure that all attributes are checked.
          We init thatLeft to the number of attributes in the source.
          We decrement for each checked attribute.
          We then decrement for each ignored attribute present in that
          If the result is non-zero, then there are some extra attributes in that
          so we return unequal.
        */
      int sz = thisAttrs.size();
      int thatLeft = sz;
  
      if ((sz == 0) && (thatAttrs.size() == 0)) {
        return true;
      }
  
      NamingEnumeration ne = thisAttrs.getAll();
  
      if (ne == null) {
        return false;
      }
  
      while (ne.hasMore()) {
        Attribute attr = (Attribute)ne.next();
        String id = attr.getID();
        boolean present = false;
  
        for (int i = 0; i < attrIDs.length; i++) {
          if (id.equalsIgnoreCase(attrIDs[i])) {
            present = true;
            break;
          }
        }
        if (present) {
          // We don't compare
          if (thatAttrs.get(id) != null) thatLeft--;
        } else {
          Attribute thatAttr = thatAttrs.get(id);
          if (thatAttr == null) {
            return false;
          }
          if (!thatAttr.contains(attr)) {
            return false;
          }
          thatLeft--;
        }
      }
  
      return (thatLeft == 0);
    }
docs: This compares all but the named attributes
  allbut true => All must be equal except those on the list
  
  @param that
  @param attrIDs
  @return boolean
  @throws NamingException