@Test
  public void testOneLocator() {
    String locators = hostName + "[" + port2 + "]";

    startLocatorWithSomeBasicProperties(vm0, port2);

    SerializableRunnable connect = new SerializableRunnable("Connect to " + locators) {
      @Override
      public void run() {
        Properties props = getBasicProperties(locators);
        props.setProperty(MEMBER_TIMEOUT, "1000");
        addDSProps(props);

        getConnectedDistributedSystem(props);
      }
    };

    vm1.invoke(connect);
    vm2.invoke(connect);

    Properties props = getBasicProperties(locators);
    props.setProperty(MEMBER_TIMEOUT, "1000");
    addDSProps(props);

    system = getConnectedDistributedSystem(props);

    DistributedMember coord = MembershipManagerHelper.getCoordinator(system);
    logger.info("coordinator before termination of locator is " + coord);

    vm0.invoke(LocatorDUnitTest::stopLocator);

    // now ensure that one of the remaining members became the coordinator

    await().until(() -> !coord.equals(MembershipManagerHelper.getCoordinator(system)));

    DistributedMember newCoord = MembershipManagerHelper.getCoordinator(system);
    logger.info("coordinator after shutdown of locator was " + newCoord);
    if (coord.equals(newCoord)) {
      fail("another member should have become coordinator after the locator was stopped");
    }
  }
Tests starting one locator in a remote VM and having multiple members of the distributed system
join it. This ensures that members start up okay, and that handling of a stopped locator is
correct.
<p>
The locator is then restarted and is shown to take over the role of membership coordinator.
geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java