private LockServiceMXBean awaitLockServiceMXBean(final String lockServiceName) {
    SystemManagementService service = managementTestRule.getSystemManagementService();

    GeodeAwaitility.await().untilAsserted(
        () -> assertThat(service.getLocalLockServiceMBean(lockServiceName)).isNotNull());

    return service.getLocalLockServiceMBean(lockServiceName);
  }
Await creation of local LockServiceMXBean for specified lockServiceName.
geode-core/src/distributedTest/java/org/apache/geode/management/DLockManagementDUnitTest.java