private static List<OsmElement> convertToOsmElements(OsmXml osmInfo) {
    List<OsmElement> elements = new ArrayList<>();
    for (var node : orEmpty(osmInfo.nodes())) {
      var newNode = new OsmElement.Node(node.id(), node.lat(), node.lon());
      elements.add(newNode);
      for (var tag : orEmpty(node.tags())) {
        newNode.setTag(tag.k(), tag.v());
      }
    }
    for (var way : orEmpty(osmInfo.ways())) {
      var readerWay = new OsmElement.Way(way.id());
      elements.add(readerWay);
      for (var tag : orEmpty(way.tags())) {
        readerWay.setTag(tag.k(), tag.v());
      }
      for (var nodeRef : orEmpty(way.nodeRefs())) {
        readerWay.nodes().add(nodeRef.ref());
      }
    }
    for (var relation : orEmpty(osmInfo.relation())) {
      var readerRelation = new OsmElement.Relation(relation.id());
      elements.add(readerRelation);
      for (var tag : orEmpty(relation.tags())) {
        readerRelation.setTag(tag.k(), tag.v());
      }
      for (var member : orEmpty(relation.members())) {
        readerRelation.members().add(new OsmElement.Relation.Member(switch (member.type()) {
          case "way" -> OsmElement.Type.WAY;
          case "relation" -> OsmElement.Type.RELATION;
          case "node" -> OsmElement.Type.NODE;
          default -> throw new IllegalStateException("Unexpected value: " + member.type());
        }, member.ref(), member.role()));
      }
    }
    return elements;
  }
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