private void assertCompactionTimeStat(final long compactionTime, final ASSERT_OP op) {
    ManagementService service = ManagementService.getExistingManagementService(getCache());
    assertThat(service).isNotNull();

    assertThat(service.isManager()).isTrue();

    MemberMXBean memberBean = service.getMemberMXBean();
    assertThat(memberBean).isNotNull();

    switch (op) {
      case EQUAL:
        assertThat(memberBean.getOffHeapCompactionTime()).isEqualTo(compactionTime);
        break;
      case GREATER_THAN:
        assertThat(compactionTime < memberBean.getOffHeapCompactionTime()).isTrue();
        break;
      case GREATER_THAN_OR_EQUAL:
        assertThat(compactionTime <= memberBean.getOffHeapCompactionTime()).isTrue();
        break;
      case LESS_THAN:
        assertThat(compactionTime > memberBean.getOffHeapCompactionTime()).isTrue();
        break;
    }
  }
Asserts that the compactionTime stat is available and satisfies an assert operation.

@param compactionTime total off heap compaction time.
@param op an assert operation.
geode-core/src/distributedTest/java/org/apache/geode/management/OffHeapManagementDUnitTest.java