private String getDifferenceInfo(Object actualRow, Object expectedRow) {
    if (actualRow instanceof List && expectedRow instanceof List) {
      List<Object> actualList = (List) actualRow;
      final int actualSize = actualList.size();
      List<Object> expectedList = (List) expectedRow;
      final int expectedSize = expectedList.size();
      if (actualSize != expectedSize) {
        return "Actual size " + actualSize + ", expected size " + expectedSize;
      }
      for (int i = 0; i < actualSize; i++) {
        Object actualObject = actualList.get(i);
        Object expecedObject = expectedList.get(i);
        if (!actualObject.equals(expecedObject)) {
          return "Column " + i + " is different";
        }
      }
    } else {
      if (!actualRow.equals(expectedRow)) {
        return "Object is different";
      }
    }
    return "Actual and expected row are the same";
  }
Unit test for the vectorized serialize and deserialize row.
ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorSerDeRow.java