diff --git a/src/main/java/org/openmaptiles/layers/Poi.java b/src/main/java/org/openmaptiles/layers/Poi.java index 70e4aa34..c8cbbad6 100644 --- a/src/main/java/org/openmaptiles/layers/Poi.java +++ b/src/main/java/org/openmaptiles/layers/Poi.java @@ -222,7 +222,7 @@ public void finish(String sourceName, FeatureCollector.Factory featureCollectors } try { // find first based on subclass - var firstSubclass = aggStopSet.stream().sorted(BY_SUBCLASS).toArray(Tables.OsmPoiPoint[]::new)[0].subclass(); + var firstSubclass = aggStopSet.stream().min(BY_SUBCLASS).get().subclass(); var topAggStops = aggStopSet.stream().filter(s -> firstSubclass.equals(s.subclass())).toArray(Tables.OsmPoiPoint[]::new); if (topAggStops.length <= 2) {