private boolean isShortStubEdge(Edge edge) {
    return edge != null && !edge.removed && edge.length < stubMinLength &&
      (edge.from.getEdges().size() == 1 || edge.to.getEdges().size() == 1 || edge.isLoop());
  }
Adds a geometry to the merger. Only linestrings from the input geometry are considered.
planetiler-core/src/main/java/com/onthegomap/planetiler/util/LoopLineMerger.java