private void validateStats(PartitionedRegion pr) {
    Statistics stats = pr.getPrStats().getStats();
    int bucketCount = stats.get("bucketCount").intValue();
    int putsCompleted = stats.get("putsCompleted").intValue();
    int totalBucketSize = stats.get("dataStoreEntryCount").intValue();

    assertEquals(0, bucketCount);
    assertEquals(0, putsCompleted);
    assertEquals(0, totalBucketSize);
    int totalGets = 0;

    final int bucketMax = pr.getTotalNumberOfBuckets();
    for (int i = 0; i < bucketMax + 1; i++) {
      Long val = (long) i;
      try {
        pr.put(val, val);
      } catch (PartitionedRegionStorageException ex) {
        logger.warn(ex);
      }
    }
    for (int i = 0; i < bucketMax + 1; i++) {
      Long val = (long) i;
      try {
        pr.get(val);
        totalGets++;
      } catch (PartitionedRegionStorageException ex) {
        logger.warn(ex);
      }
    }


    bucketCount = stats.get("bucketCount").intValue();
    putsCompleted = stats.get("putsCompleted").intValue();
    totalBucketSize = stats.get("dataStoreEntryCount").intValue();

    assertEquals(bucketMax, bucketCount);
    assertEquals(bucketMax + 1, putsCompleted);
    assertEquals(bucketMax + 1, totalBucketSize);

    pr.destroy((long) bucketMax);

    putsCompleted = stats.get("putsCompleted").intValue();
    totalBucketSize = stats.get("dataStoreEntryCount").intValue();

    assertEquals(bucketMax, bucketCount);
    assertEquals(bucketMax + 1, putsCompleted);
    assertEquals(bucketMax, totalBucketSize);

    for (int i = 200; i < 210; i++) {
      Long key = (long) i;
      String val = "" + i;
      try {
        pr.create(key, val);
      } catch (PartitionedRegionStorageException ex) {
        logger.warn(ex);
      }
    }
    for (int i = 200; i < 210; i++) {
      Long key = (long) i;
      try {
        pr.get(key);
        totalGets++;
      } catch (PartitionedRegionStorageException ex) {
        logger.warn(ex);
      }
    }


    for (int i = 200; i < 210; i++) {
      Long key = (long) i;
      try {
        // noinspection ResultOfMethodCallIgnored
        pr.containsKey(key);
      } catch (PartitionedRegionStorageException ex) {
        logger.warn(ex);
      }
    }

    for (int i = 200; i < 210; i++) {
      Long key = (long) i;
      try {
        pr.containsValueForKey(key);
      } catch (PartitionedRegionStorageException ex) {
        logger.warn(ex);
      }
    }

    for (int i = 200; i < 210; i++) {
      Long key = (long) i;
      try {
        pr.invalidate(key);
      } catch (PartitionedRegionStorageException ex) {
        logger.warn(ex);
      }
    }
    int getsCompleted = stats.get("getsCompleted").intValue();
    int createsCompleted = stats.get("createsCompleted").intValue();
    int containsKeyCompleted = stats.get("containsKeyCompleted").intValue();
    int containsValueForKeyCompleted = stats.get("containsValueForKeyCompleted").intValue();
    int invalidatesCompleted = stats.get("invalidatesCompleted").intValue();
    int destroysCompleted = stats.get("destroysCompleted").intValue();

    assertEquals(totalGets, getsCompleted);
    assertEquals(10, createsCompleted);
    assertEquals(10, containsKeyCompleted);
    assertEquals(10, containsValueForKeyCompleted);
    assertEquals(10, invalidatesCompleted);
    assertEquals(1, destroysCompleted);

    // Redundant copies related statistics
    /*
     * int maxRedundantCopies = stats.get("maxRedundantCopies").intValue(); int minRedundantCopies =
     * stats.get("minRedundantCopies").intValue(); int avgRedundantCopies =
     * stats.get("avgRedundantCopies").intValue();
     *
     * assertIndexDetailsEquals(minRedundantCopies, 2); assertIndexDetailsEquals(maxRedundantCopies,
     * 2); assertIndexDetailsEquals(avgRedundantCopies, 2);
     */
  }
This method verifies that PR statistics are working properly for a PartitionedRegion.
putsCompleted, getsCompleted, createsCompleted, destroysCompleted, containsKeyCompleted,
containsValueForKeyCompleted, invalidatesCompleted, totalBucketSize and temporarily commented
avgRedundantCopies, maxRedundantCopies, minRedundantCopies are validated in this method.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/PartitionedRegionStatsJUnitTest.java