@Test
  void iteratorReturnsIteratorThatDoesNotSupportRemoveBeforeOrAfterNext() {
    final HostAndPort locator1 = new HostAndPort("locator1", 1234);
    final HostAndPort locator2 = new HostAndPort("locator2", 1234);
    final Iterator<@NotNull HostAndPort> iterator = new LocatorList(asList(locator1, locator2))
        .iterator();

    assertThatThrownBy(iterator::remove).isInstanceOf(UnsupportedOperationException.class);
    iterator.next();
    assertThatThrownBy(iterator::remove).isInstanceOf(UnsupportedOperationException.class);
  }
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