@Test
  public void testLocatorsDUnitTest() {
    initManagement(false);
    int locatorCount =
        ((Number) managingNode.invoke(TestLocatorsDUnitTest::getNumOfLocatorFromMBean))
            .intValue();
    LogWriterUtils.getLogWriter().info("TestLocatorsDUnitTest locatorCount =" + locatorCount);
    assertEquals(1, locatorCount);

  }
This is for testing locators from MBean
geode-core/src/distributedTest/java/org/apache/geode/management/internal/pulse/TestLocatorsDUnitTest.java