Node (String name, int offset, Map<String, RangeMarker> sliceUsageName2Offset) { List<Node> children = new ArrayList<>(); for (int i = 1; i < 9; i++) { String newName = name + i; RangeMarker marker = sliceUsageName2Offset.get(newName); if (marker == null) break; children.add(buildNode(newName, marker.getStartOffset(), sliceUsageName2Offset)); } return new Node(offset, children); }