private Boolean verifyLocatorsMatched(InetSocketAddress[] expected,
      List<InetSocketAddress> initialLocators) {

    if (expected.length != initialLocators.size()) {
      return false;
    }

    Arrays.sort(expected, Comparator.comparing(InetSocketAddress::getPort));

    assertThat(initialLocators).containsExactly(expected);

    for (int i = 0; i < initialLocators.size(); i++) {
      InetSocketAddress locatorAddress = initialLocators.get(i);
      InetSocketAddress expectedAddress = expected[i];

      if (!expectedAddress.equals(locatorAddress)) {
        assertThat(locatorAddress).isEqualTo(expectedAddress);
        return false;
      }
    }
    return true;
  }
Assert that there is one endpoint with the given host in port on the client vm.

@param vm - the vm the client is running in
@param expectedPorts - The server ports we expect the client to be connected to.
geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/AutoConnectionSourceDUnitTest.java