@Override public boolean deepEquals(Node node) { if (this == node) { return true; } if (!(node instanceof Document)) { return false; } final Document other = (Document) node; if (getChildrenCount() == other.getChildrenCount()) { for (int index = 0; index < getChildrenCount(); index++) { if (!getChildAt(index).deepEquals(other.getChildAt(index))) { return false; } } } else { return false; } return true; }
@Override public boolean deepEquals(Node node) { if (this == node) { return true; } if (!(node instanceof Element)) { return false; } final Element other = (Element) node; if (getChildrenCount() == other.getChildrenCount() && localEquals(other)) { for (int index = 0; index < getChildrenCount(); index++) { if (!getChildAt(index).deepEquals(other.getChildAt(index))) { return false; } } return true; } else { return false; } }