@Test
  public void testOffHeapMBeanAttributesAndStats() throws Exception {
    // Setup off-heap memory for cache
    setSystemPropertiesOnVm(vm, true, getDistributedSystemProperties());

    // Create our off-heap region
    assertThat(createOffHeapRegionOnVm(vm, OFF_HEAP_REGION_NAME, DataPolicy.REPLICATE)).isNotNull();

    // Make sure our off-heap region has off-heap enabled.
    assertOffHeapRegionAttributesOnVm(vm);

    // Make sure our starting off heap stats are correct
    assertOffHeapMetricsOnVm(vm, TOTAL_MEMORY, 0, 0, 0);

    /*
     * Perform ops on the off-heap region and assert that the off-heap metrics correctly reflect the
     * ops
     */
    doPutOnVm(vm, KEY, VALUE, OFF_HEAP_REGION_NAME, false);
    assertOffHeapMetricsOnVm(vm, (TOTAL_MEMORY - OBJECT_SIZE), OBJECT_SIZE, 1, 0);

    doPutOnVm(vm, KEY2, VALUE, OFF_HEAP_REGION_NAME, false);
    assertOffHeapMetricsOnVm(vm, (TOTAL_MEMORY - (2 * OBJECT_SIZE)), (2 * OBJECT_SIZE), 2, 0);

    doPutOnVm(vm, KEY3, VALUE, OFF_HEAP_REGION_NAME, false);
    assertOffHeapMetricsOnVm(vm, (TOTAL_MEMORY - (3 * OBJECT_SIZE)), (3 * OBJECT_SIZE), 3, 0);

    doDestroyOnVm(vm, KEY3, OFF_HEAP_REGION_NAME);
    assertOffHeapMetricsOnVm(vm, (TOTAL_MEMORY - (2 * OBJECT_SIZE)), (2 * OBJECT_SIZE), 2, 0);

    doDestroyOnVm(vm, KEY2, OFF_HEAP_REGION_NAME);
    assertOffHeapMetricsOnVm(vm, (TOTAL_MEMORY - OBJECT_SIZE), OBJECT_SIZE, 1, 0);

    doDestroyOnVm(vm, KEY, OFF_HEAP_REGION_NAME);
    assertOffHeapMetricsOnVm(vm, TOTAL_MEMORY, 0, 0, 0);
  }
Tests off-heap additions to the RegionMXBean and MemberMXBean interfaces.
geode-core/src/distributedTest/java/org/apache/geode/management/OffHeapManagementDUnitTest.java