public static int compareRecordContents(List<Object> first, List<Object> second,
                                          StringBuilder debugDetail) {
    int mySz = first.size();
    int urSz = second.size();
    if (mySz != urSz) {
      return mySz - urSz;
    } else {
      for (int i = 0; i < first.size(); i++) {
        int c = DataType.compare(first.get(i), second.get(i));
        if (c != 0) {
          if(debugDetail != null) {
            String msg = "first.get(" + i + "}='" + first.get(i) + "' second.get(" +
                    i + ")='" + second.get(i) + "' compared as " + c + "\n" +
            "Types 1st/2nd=" + DataType.findType(first.get(i)) + "/" +DataType.findType(
                    second.get(i)) + '\n' +
                    "first='" + first.get(i) + "' second='" + second.get(i) + "'";
            if(first.get(i) instanceof Date) {
              msg += "\n((Date)first.get(i)).getTime()=" + ((Date)first.get(i)).getTime();
            }
            if(second.get(i) instanceof Date) {
              msg += "\n((Date)second.get(i)).getTime()=" + ((Date)second.get(i)).getTime();
            }

            debugDetail.append(msg);
            throw new RuntimeException(debugDetail.toString());
          }
          return c;
        }
      }
      return 0;
    }
  }
Helper class for Other Data Testers
hcatalog/core/src/test/java/org/apache/hive/hcatalog/data/HCatDataCheckUtil.java