public static String compareResultSets(SelectResults sr1, SelectResults sr2) {


    ObjectType type1, type2;
    String failureString = null;
    type1 = sr1.getCollectionType().getElementType();
    Assert.assertNotNull("PartitionedRegionTestHelper#compareResultSets: Type 1 is NULL " + type1,
        type1);
    type2 = sr2.getCollectionType().getElementType();
    Assert.assertNotNull("PartitionedRegionTestHelper#compareResultSets: Type 2 is NULL " + type2,
        type2);
    if ((type1.getClass().getName()).equals(type2.getClass().getName())) {

      getLogger().info(
          "PartitionedRegionTestHelper#compareResultSets: Both Search Results are of the same Type i.e.--> "
              + type1);

    } else {
      getLogger().error("PartitionedRegionTestHelper#compareTwoQueryResults: Classes are : "
          + type1.getClass().getName() + " " + type2.getClass().getName());
      failureString =
          "PartitionedRegionTestHelper#compareResultSets: FAILED:Search result Type is different in both the cases"
              + type1.getClass().getName() + " " + type2.getClass().getName();

      Assert.fail(
          "PartitionedRegionTestHelper#compareResultSets: FAILED:Search result Type is different in both the cases");
      return failureString;
    }
    if ((sr1.size()) == (sr2.size())) {
      getLogger().info(
          "PartitionedRegionTestHelper#compareResultSets: Both Search Results are non-zero and are of Same Size i.e.  Size= "
              + sr1.size());

    } else {
      getLogger().error(
          "PartitionedRegionTestHelper#compareResultSets: FAILED:Search resultSet size are different in both the cases");
      failureString =
          "PartitionedRegionTestHelper#compareResultSets: FAILED:Search resultSet size are different in both the cases"
              + sr1.size() + " " + sr2.size();
      Assert.fail(
          "PartitionedRegionTestHelper#compareResultSets: FAILED:Search resultSet size are different in both the cases");

    }
    return failureString;
  }
This method compares two selectResult Objects by 1. Size 2.
SelectResults#CollectionType#ElementType()
geode-junit/src/main/java/org/apache/geode/internal/cache/PartitionedRegionTestHelper.java