@Test
  void getLocatorsReturnsInetSocketAddressesInOrderInNewList() {
    final List<HostAndPort> locators = asList(
        new HostAndPort("locator2", 1234),
        new HostAndPort("locator1", 1234));

    final LocatorList locatorList = new LocatorList(locators);

    final List<InetSocketAddress> locators1 = locatorList.getLocators();
    final List<InetSocketAddress> locators2 = locatorList.getLocators();

    assertThat(locators1)
        .isNotNull()
        .isEqualTo(locators2)
        .isNotSameAs(locators2)
        .containsExactly(InetSocketAddress.createUnresolved("locator1", 1234),
            InetSocketAddress.createUnresolved("locator2", 1234));
  }
The explicit order of these isn't important, only that it be consistent.
geode-core/src/test/java/org/apache/geode/cache/client/internal/LocatorListTest.java