Check that all the rows and elements defined in the doc1 are included in doc2

@param doc1 The source document
@param doc2 The checked document
@return True if all the elements defined in the doc1 exists in the doc2
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)
    }
953671
protected boolean tieBreak(final T object1, final T object2) {
    if (null == object2) {
      return true;
    }
    if (null == object1) {
      return false;
    }
    return object1.hashCode() >= object2.hashCode();
  }
1110832
private boolean goToNextDoc() throws IOException {
    reset();
    if (docId == NO_MORE_DOCS) {
      minPosition = NO_MORE_POSITIONS;
      maxPosition = NO_MORE_POSITIONS;
      return true;
    } else {
      docId = subSpans.nextDoc();
      if (docId == NO_MORE_DOCS) {
        minPosition = NO_MORE_POSITIONS;
        maxPosition = NO_MORE_POSITIONS;
        return true;
      } else {
        IndexDoc doc = mtasCodecInfo.getDoc(field, docId);
        if (doc != null) {
          minPosition = doc.minPosition;
          maxPosition = doc.maxPosition;
        } else {
          minPosition = NO_MORE_POSITIONS;
          maxPosition = NO_MORE_POSITIONS;
        }
        if (goToNextStartPosition()) {
          return true;
        } else {
          return false;
        }
      }
    }
  }
453623
public boolean hasNotes() {
        for (Object m_staffElement : m_staffElements) {
            JScoreElement element = (JScoreElement) m_staffElement;
            if ((element instanceof JNoteElementAbstract)
                    || (element instanceof JGroupOfNotes))
                return true;
        }
		return false;
	}
771608
@Override
    public int compare(Row row1, Row row2) {
        Columns columns1 = rowMapper.columns(row1);
        Columns columns2 = rowMapper.columns(row2);
        return comparatorChain.compare(columns1, columns2);
    }
588063
public boolean isSubclassOf(TypeElement t1, TypeElement t2) {
        return typeUtils.isSubtype(t1.asType(), t2.asType());
    }
704248
private static boolean isPartialRow(Iterable<ExpandedPair> pairs, Iterable<ExpandedRow> rows) {
    for (ExpandedRow r : rows) {
      boolean allFound = true;
      for (ExpandedPair p : pairs) {
        boolean found = false;
        for (ExpandedPair pp : r.getPairs()) {
          if (p.equals(pp)) {
            found = true;
            break;
          }
        }
        if (!found) {
          allFound = false;
          break;
        }
      }
      if (allFound) {
        // the row 'r' contain all the pairs from 'pairs'
        return true;
      }
    }
    return false;
  }
961587
public static void elementDiv( DMatrix2 a , DMatrix2 b) {
        a.a1 /= b.a1;
        a.a2 /= b.a2;
    }
1055645
def __isListOfLists(self, docs):
        
        return isinstance(docs, list) and \
               all(self.__isListOfTexts(ds) for ds in docs)
950088
public static boolean areElementEquals(Element element1, Element element2) {
		for (Mask mask1 : element1.getMask()) {
			if (!areBooleanEquals(element1.isNegated(), element2.isNegated())) {
				// Negated.
				return false;
			}
			for (Mask mask2 : element2.getMask()) {
				if (!areStringEquals(mask1.getLexemeMask(), mask2.getLexemeMask())) {
					// LexemeMask.
					return false;
				} else if (!areStringEquals(mask1.getPrimitiveMask(), mask2.getPrimitiveMask())) {
					// PrimitiveMask.
					return false;
				} else if (!areTagMaskEquals(mask1.getTagMask(), mask2.getTagMask())) {
					// TagMask.
					return false;
				}
			}
		}
		return true;
	}
954433
private boolean twoPhaseCurrentDocMatches() throws IOException {
    if (docId != spans1.spans.docID()) {
      reset();
      docId = spans1.spans.docID();
    }
    if (docId == NO_MORE_DOCS) {
      return false;
    } else {
      int spans2DocId = spans2.spans.docID();
      if (spans2DocId < docId) {
        spans2DocId = spans2.spans.advance(docId);
      }
      if (docId != spans2DocId) {
        return spans1.spans.nextStartPosition() != NO_MORE_POSITIONS;
      } else {
        return goToNextStartPosition();
      }
    }
  }
105941
private boolean goToNextDoc() throws IOException {
    if (docId == NO_MORE_DOCS) {
      return true;
    } else {
      int spans1DocId = spans1.spans.nextDoc();
      int spans2DocId = spans2.spans.docID();
      docId = Math.max(spans1DocId, spans2DocId);
      while (spans1DocId != spans2DocId && docId != NO_MORE_DOCS) {
        if (spans1DocId < spans2DocId) {
          spans1DocId = spans1.spans.advance(spans2DocId);
          docId = spans1DocId;
        } else {
          spans2DocId = spans2.spans.advance(spans1DocId);
          docId = spans2DocId;
        }
      }
      if (docId != NO_MORE_DOCS && !goToNextStartPosition()) {
        reset();
        return false;
      } else {
        return true;
      }
    }
  }
1205306
public boolean isExternal(ProgramElementDoc doc) {
        if (packageToItemMap == null) {
            return false;
        }
        return packageToItemMap.get(doc.containingPackage().name()) != null;
    }
402222
public final boolean overlaps(HString other) {
      if (other == null) {
         return false;
      }
      return (document() != null && other.document() != null) &&
                (document() == other.document()) &&
                super.overlaps(other);
   }
1122877
private static boolean hasSameContent(final InputStream stream1, final InputStream stream2) throws IOException {
    int byte1 = -1;
    int byte2 = -1;
    do {
      byte1 = stream1.read();
      byte2 = stream2.read();

    } while (byte1 == byte2 && byte1 != -1);
    return byte1 == byte2;
  }
500563
public static boolean compareQNameLists(List<QName> list1, List<QName> list2) {
        if (list1 == list2)
            return true;
        if (list1 == null || list2 == null)
            return false;
        if (list1.size() != list2.size())
            return false;

        for (int i = 0; i < list1.size(); i++) {
            if (!compareQNames(list1.get(i), list2.get(i)))
                return false;
        }

        return true;
    }
671618
public static boolean isEqualOrNull( Object s1,
                                         Object s2 ) {
        if ( s1 == null
                && s2 == null ) {
            return true;
        } else if ( s1 != null
                && s2 != null
                && s1.equals( s2 ) ) {
            return true;
        }
        return false;
    }