@Test
  public void testOffHeapAllocatedSizeMonitoring() 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);

    /*
     * Tests off-heap objects notification
     */
    setupOffHeapMonitorOnVm(vm, "OffHeapAllocatedSize", 0, OBJECT_SIZE);

    clearNotificationListenerOnVm(vm);

    doPutOnVm(vm, KEY, VALUE, OFF_HEAP_REGION_NAME, false);

    waitForNotificationListenerOnVm(vm, 5000);
  }
Asserts that a monitor assigned to the OffHeapAllocatedSize attribute is triggered.
geode-core/src/distributedTest/java/org/apache/geode/management/OffHeapManagementDUnitTest.java