private void validatePotentialManagers(final VM locatorVM,
      final int expectedNumberPotentialManagers) {
    locatorVM.invoke("List Willing Managers", () -> {
      LocatorMXBean locatorMXBean = awaitLocalLocatorMXBean();

      await()
          .untilAsserted(() -> assertThat(locatorMXBean.listPotentialManagers())
              .hasSize(expectedNumberPotentialManagers));
    });
  }
Starts a locator with given configuration. If DS is already started it will use the same DS
geode-core/src/distributedTest/java/org/apache/geode/management/LocatorManagementDUnitTest.java