private void processOsmFeatures(FeatureGroup featureGroup, Profile profile, PlanetilerConfig config,
    List<? extends OsmElement> osmElements) throws IOException {
    OsmBlockSource elems = next -> {
      // process the same order they come in from an OSM file
      next.accept(OsmBlockSource.Block.of(osmElements.stream().filter(e -> e instanceof OsmElement.Other).toList()));
      next.accept(OsmBlockSource.Block.of(osmElements.stream().filter(e -> e instanceof OsmElement.Node).toList()));
      next.accept(OsmBlockSource.Block.of(osmElements.stream().filter(e -> e instanceof OsmElement.Way).toList()));
      next.accept(OsmBlockSource.Block.of(osmElements.stream().filter(e -> e instanceof OsmElement.Relation).toList()));
    };
    var nodeMap = LongLongMap.newInMemorySortedTable();
    var multipolygons = LongLongMultimap.newInMemoryReplaceableMultimap();
    try (var reader = new OsmReader("osm", () -> elems, nodeMap, multipolygons, profile, Stats.inMemory())) {
      reader.pass1(config);
      reader.pass2(featureGroup, config);
    }
  }
In-memory tests with fake data and profiles to ensure all features work end-to-end.
planetiler-core/src/test/java/com/onthegomap/planetiler/PlanetilerTests.java