private void compareTwoQueryResults(Object[][] r, int len) {

    for (int j = 0; j < len; j++) {
      if ((r[j][0] != null) && (r[j][1] != null)) {
        ObjectType type1 = ((SelectResults) r[j][0]).getCollectionType().getElementType();
        assertNotNull("PRQueryDUnitHelper#compareTwoQueryResults: Type 1 is NULL " + type1, type1);
        ObjectType type2 = ((SelectResults) r[j][1]).getCollectionType().getElementType();
        assertNotNull("PRQueryDUnitHelper#compareTwoQueryResults: Type 2 is NULL " + type2, type2);
        if ((type1.getClass().getName()).equals(type2.getClass().getName())) {
          LogWriterUtils.getLogWriter().info(
              "PRQueryDUnitHelper#compareTwoQueryResults: Both Search Results are of the same Type i.e.--> "
                  + ((SelectResults) r[j][0]).getCollectionType().getElementType());

        } else {
          LogWriterUtils.getLogWriter()
              .error("PRQueryDUnitHelper#compareTwoQueryResults: Classes are : "
                  + type1.getClass().getName() + " " + type2.getClass().getName());

          fail(
              "PRQueryDUnitHelper#compareTwoQueryResults: FAILED:Search result Type is different in both the cases");
        }
        int size0 = ((SelectResults) r[j][0]).size();
        int size1 = ((SelectResults) r[j][1]).size();
        if (size0 == size1) {
          LogWriterUtils.getLogWriter().info(
              "PRQueryDUnitHelper#compareTwoQueryResults: Both Search Results are non-zero and are of Same Size i.e.  Size= "
                  + size1 + ";j=" + j);

        } else {
          LogWriterUtils.getLogWriter().error(
              "PRQueryDUnitHelper#compareTwoQueryResults: FAILED:Search resultSet size are different in both cases; size0="
                  + size0 + ";size1=" + size1 + ";j=" + j);
          fail(
              "PRQueryDUnitHelper#compareTwoQueryResults: FAILED:Search resultSet size are different in both cases; size0="
                  + size0 + ";size1=" + size1 + ";j=" + j);
        }
        Set set2 = (((SelectResults) r[j][1]).asSet());
        Set set1 = (((SelectResults) r[j][0]).asSet());

        assertEquals("PRQueryDUnitHelper#compareTwoQueryResults: FAILED: "
            + "result contents are not equal, ", set1, set2);
      }
    }
  }
This function creates a Accessor node region on the given PR given the scope parameter.

@return cacheSerializable object
geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryDUnitHelper.java