private Edge degreeTwoMerge(Node node) {
    if (node.getEdges().size() == 2) {
      Edge a = node.getEdges().getFirst();
      Edge b = node.getEdges().get(1);
      // if one side is a loop, degree is actually > 2
      if (!a.isLoop() && !b.isLoop()) {
        return mergeTwoEdges(node, a, b);
      }
    }
    return null;
  }
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