Compare two DOM documents

@param d1 First DOM document
@param d2 Second DOM document
@return true if both are equal
@throws MarshalException
772797
public static boolean compare(Document d1, Document d2) throws MarshalException {
		d1.normalize();
		d2.normalize();
		return d1.isEqualNode(d2);
	}
855113
public static Date min(Date d1, Date d2)
   {
      Date result;
      if (d1 == null)
      {
         result = d2;
      }
      else
         if (d2 == null)
         {
            result = d1;
         }
         else
         {
            result = (d1.compareTo(d2) < 0) ? d1 : d2;
         }
      return result;
   }
771608
@Override
    public int compare(Row row1, Row row2) {
        Columns columns1 = rowMapper.columns(row1);
        Columns columns2 = rowMapper.columns(row2);
        return comparatorChain.compare(columns1, columns2);
    }
470475
@Override
    public int compare(DependencyReportToArchiveEdgeModel o1, DependencyReportToArchiveEdgeModel o2)
    {
        String path1 = o1.getFullPath();
        String path2 = o2.getFullPath();
        return filePathComparator.compare(path1, path2);
    }
240012
public List<JsonDelta> computeDiff(String node1, String node2) throws IOException {
        ObjectMapper mapper = new ObjectMapper();
        return computeDiff(mapper.readTree(node1), mapper.readTree(node2));
    }
1035197
public static boolean xpathExists(Node document, String xpathExpression, Map<String, String> namespaceMapping) throws XPathException,
                MarshallingException
    {
        Boolean result = (Boolean) executeXPath(document, xpathExpression, namespaceMapping, XPathConstants.BOOLEAN);
        return result != null && result;
    }
408377
@Override
	public int compare(E entity1, E entity2) {
		T value = property.get(entity1);
		T value2 = property.get(entity2);
		return value.compareTo(value2);
	}
1161000
public static boolean areEqual(String s1, String s2) {
        return (s1 == null) ? s2 == null : s1.equals(s2);
    }
198513
public boolean compare(Document doc1, Document doc2, String tableName) {
        NodeList nl = doc1.getElementsByTagName("Row");
        for (int i = 0; i < nl.getLength(); i++) {
            Node n = nl.item(i);
            // check if the rows belongs to the table name
            Node tableNodeNameAttr = n.getParentNode().getAttributes().getNamedItem("name");
            String tableNameAttr = tableNodeNameAttr.getNodeValue();
            if (!tableNameAttr.equals(tableName)) {
                continue;
            }
            Node tableNodeKeyAttr = n.getParentNode().getAttributes().getNamedItem("key");
            String tableKeyAttr = tableNodeKeyAttr.getNodeValue();
            String[] primaryKeyFields = new String[] {tableKeyAttr};
            return compare(doc1, doc2, tableName, primaryKeyFields);

        }
        return true; // table is not to be compared (not found)
    }
743503
public static <T> boolean isEqual(final T first, final T second) {
        /* test to see if they are both null, or both reference the same object */
        if (first == second) return true;

        if (first == null && second != null) return false;

        return first.equals(second);
    }
925430
@Override
    public int compare( SimpleFeature f1, SimpleFeature f2 ) {
        int linkid1 = (Integer) f1.getAttribute(LINKID);
        int linkid2 = (Integer) f2.getAttribute(LINKID);

        if (linkid1 < linkid2) {
            return -1;
        } else if (linkid1 > linkid2) {
            return 1;
        } else {
            return 0;
        }
    }
367043
public static boolean isEqualOrNull( Map s1,
                                         Map s2 ) {
        if ( s1 == null
                && s2 == null ) {
            return true;
        } else if ( s1 != null
                && s2 != null
                && s1.size() == s2.size() ) {
            return true;
        }
        return false;
    }
467302
@Override
    public int compare(final Issue i1, final Issue i2) {

        if (null == i1 && null == i2) {
            return 0;
        } else if (null == i1) {
            return 1;
        } else if (null == i2) {
            return -1;
        } else {
            return i1.getCreatedOn().compareTo(i2.getCreatedOn());
        }
    }
1119377
private boolean match(JsDocToken token1, JsDocToken token2) {
    unreadToken = next();
    return unreadToken == token1 || unreadToken == token2;
  }
1084201
public static boolean isEquals( String s1, String s2)
	{
		return s1 == null ? s2 == null : s1.equals(s2);
	}
710265
private boolean extendedIdentifierEquals(String eid1, String eid2) {
		try {
			return DomHelpers.compare(DomHelpers.toDocument(eid1, null),
					DomHelpers.toDocument(eid2, null));
		} catch (MarshalException e) {
			return false;
		}
	}
209631
public static function compare(AbstractCalendarDate $d1, AbstractCalendarDate $d2): int
    {
        if ($d1->maximum_julian_day < $d2->minimum_julian_day) {
            return -1;
        }

        if ($d2->maximum_julian_day < $d1->minimum_julian_day) {
            return 1;
        }

        return 0;
    }