public boolean areEqual(Object o0, Object o1) {
      if (o0 == null && o1 == null) {
        return true;
      } else if (o0 == null || o1 == null) {
        return false;
      }
      switch (compareType) {
      case COMPARE_TEXT:
        return (soi0.getPrimitiveWritableObject(o0).equals(
            soi1.getPrimitiveWritableObject(o1)));
      case COMPARE_INT:
        return (ioi0.get(o0) == ioi1.get(o1));
      case COMPARE_LONG:
        return (loi0.get(o0) == loi1.get(o1));
      case COMPARE_BYTE:
        return (byoi0.get(o0) == byoi1.get(o1));
      case COMPARE_BOOL:
        return (boi0.get(o0) == boi1.get(o1));
      case COMPARE_STRING:
        return (soi0.getPrimitiveJavaObject(o0).equals(
            soi1.getPrimitiveJavaObject(o1)));
      default:
        return (ObjectInspectorUtils.compare(
            o0, oi0, o1, oi1) == 0);
      }
    }
Compare two list of objects.
Two lists are expected to have same types. Type information for every object is
passed when calling Constructor to avoid the step of figuring out types from
ObjectInspector and determine how to compare the types when comparing.
Also, for string and text elements, it performs slightly better than
using ObjectInspectorUtils.compare() == 0, which instead of calling .compare()
calls .equalTo(), which compares size before byte by byte comparison.
serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ListObjectsEqualComparer.java