@TestFactory
  Stream<DynamicTest> testCountInternalGeometries() {
    record Case(int expected, Geometry geom) {}
    return Stream.of(
      new Case(1, newPoint(0, 0)),
      new Case(2, newMultiPoint(newPoint(0, 0), newPoint(0, 1))),
      new Case(3, newMultiPoint(newPoint(0, 0), newPoint(0, 1), newPoint(0, 2))),
      new Case(1, newLineString(0, 0, 1, 1)),
      new Case(2, newMultiLineString(
        newLineString(0, 0, 1, 1),
        newLineString(0, 0, 2, 2)
      )),
      new Case(3, newMultiLineString(
        newLineString(0, 0, 1, 1),
        newLineString(0, 0, 2, 2),
        newLineString(0, 0, 2, 3)
      )),
      new Case(1, rectangle(0, 1)),
      new Case(2, newMultiPolygon(
        rectangle(0, 1),
        rectangle(3, 4)
      )),
      new Case(3, newMultiPolygon(
        rectangle(0, 1),
        rectangle(3, 4),
        rectangle(6, 8)
      ))
    ).map(test -> dynamicTest(test.toString(),
      () -> {
        var feature = new VectorTile.Feature(
          "layer", 1, VectorTile.encodeGeometry(test.geom), Map.of()
        );
        var tile = new VectorTile()
          .addLayerFeatures("layer", List.of(feature));
        assertEquals(test.expected, VectorTile.countGeometries(tile.toProto().getLayers(0).getFeatures(0)));
      }));
  }
This class is copied from
https://github.com/ElectronicChartCentre/java-vector-tile/blob/master/src/test/java/no/ecc/vectortile/VectorTileEncoderTest.java
and modified based on the changes in VectorTileEncoder, and adapted to junit 5.
planetiler-core/src/test/java/com/onthegomap/planetiler/VectorTileTest.java