docs: Collection<EdgeIteratorState> addOSMWay(final LongIndexedContainer osmNodeIds, final IntsRef flags, final long wayOsmId) {
          PointList pointList = new PointList(osmNodeIds.size(), nodeAccess.is3D());
          List<EdgeIteratorState> newEdges = new ArrayList<>(5);
          int firstNode = -1;
          int lastIndex = osmNodeIds.size() - 1;
          int lastInBoundsPillarNode = -1;
          try {
              for (int i = 0; i < osmNodeIds.size(); i++) {
                  long osmNodeId = osmNodeIds.get(i);
                  int tmpNode = getNodeMap().get(osmNodeId);
                  if (tmpNode == EMPTY_NODE)
                      continue;
  
                  // skip osmIds with no associated pillar or tower id (e.g. !OSMReader.isBounds)
                  if (tmpNode == TOWER_NODE)
                      continue;
  
                  if (tmpNode == PILLAR_NODE) {
                      // In some cases no node information is saved for the specified osmId.
                      // ie. a way references a <node> which does not exist in the current file.
                      // => if the node before was a pillar node then convert into to tower node (as it is also end-standing).
                      if (!pointList.isEmpty() && lastInBoundsPillarNode > -TOWER_NODE) {
                          // transform the pillar node to a tower node
                          tmpNode = lastInBoundsPillarNode;
                          tmpNode = handlePillarNode(tmpNode, osmNodeId, null, true);
                          tmpNode = -tmpNode - 3;
                          if (pointList.getSize() > 1 && firstNode >= 0) {
                              // TOWER node
                              newEdges.add(addEdge(firstNode, tmpNode, pointList, flags, wayOsmId));
                              pointList.clear();
                              pointList.add(nodeAccess, tmpNode);
                          }
                          firstNode = tmpNode;
                          lastInBoundsPillarNode = -1;
                      }
                      continue;
                  }
  
                  if (tmpNode <= -TOWER_NODE && tmpNode >= TOWER_NODE)
                      throw new AssertionError("Mapped index not in correct bounds " + tmpNode + ", " + osmNodeId);
  
                  if (tmpNode > -TOWER_NODE) {
                      boolean convertToTowerNode = i == 0 || i == lastIndex;
                      if (!convertToTowerNode) {
                          lastInBoundsPillarNode = tmpNode;
                      }
  
                      // PILLAR node, but convert to towerNode if end-standing
                      tmpNode = handlePillarNode(tmpNode, osmNodeId, pointList, convertToTowerNode);
                  }
  
                  if (tmpNode < TOWER_NODE) {
                      // TOWER node
                      tmpNode = -tmpNode - 3;
  
                      if (firstNode >= 0 && firstNode == tmpNode) {
                          // loop detected. See #1525 and #1533. Insert last OSM ID as tower node. Do this for all loops so that users can manipulate loops later arbitrarily.
                          long lastOsmNodeId = osmNodeIds.get(i - 1);
                          int lastGHNodeId = getNodeMap().get(lastOsmNodeId);
                          if (lastGHNodeId < TOWER_NODE) {
                              LOGGER.warn("Pillar node " + lastOsmNodeId + " is already a tower node and used in loop, see #1533. " +
                                      "Fix mapping for way " + wayOsmId + ", nodes:" + osmNodeIds);
                              break;
                          }
  
                          int newEndNode = -handlePillarNode(lastGHNodeId, lastOsmNodeId, pointList, true) - 3;
                          newEdges.add(addEdge(firstNode, newEndNode, pointList, flags, wayOsmId));
                          pointList.clear();
                          pointList.add(nodeAccess, newEndNode);
                          firstNode = newEndNode;
                      }
  
                      pointList.add(nodeAccess, tmpNode);
                      if (firstNode >= 0) {
                          newEdges.add(addEdge(firstNode, tmpNode, pointList, flags, wayOsmId));
                          pointList.clear();
                          pointList.add(nodeAccess, tmpNode);
                      }
                      firstNode = tmpNode;
                  }
              }
          } catch (RuntimeException ex) {
              LOGGER.error("Couldn't properly add edge with osm ids:" + osmNodeIds, ex);
              if (exitOnlyPillarNodeException)
                  throw ex;
          }
          return newEdges;
      }