private DynamicTest testConnect(List<LongArrayList> input, List<LongArrayList> expectedOutput) {
    return DynamicTest.dynamicTest("connectPolygonSegments(" + input + ")", () -> {
      var expected = expectedOutput.stream().sorted(Comparator.comparing(Object::toString)).toList();
      var actual = connectPolygonSegments(input);
      actual.sort(Comparator.comparing(Object::toString));
      assertEquals(expected, actual);
    });
  }
This class is ported to Java from https://github.com/omniscale/imposm3/blob/master/geom/multipolygon_test.go
planetiler-core/src/test/java/com/onthegomap/planetiler/reader/osm/OsmMultipolygonTest.java