code: private String constructDuplicatePathSql(SqlgGraph sqlgGraph, List<LinkedList<SchemaTableTree>> subQueryLinkedLists, Set<SchemaTableTree> leftJoinOn) {
          StringBuilder singlePathSql = new StringBuilder("\nFROM (");
          int count = 1;
          SchemaTableTree lastOfPrevious = null;
          for (LinkedList<SchemaTableTree> subQueryLinkedList : subQueryLinkedLists) {
              SchemaTableTree firstOfNext = null;
              boolean last = count == subQueryLinkedLists.size();
              if (!last) {
                  //this is to get the next SchemaTable to join to
                  LinkedList<SchemaTableTree> nextList = subQueryLinkedLists.get(count);
                  firstOfNext = nextList.getFirst();
              }
              SchemaTableTree firstSchemaTableTree = subQueryLinkedList.getFirst();
  
              String sql;
              if (last) {
                  //only the last step must have dropStep as true. As only the outer select needs only an ID in the select
                  sql = constructSinglePathSql(sqlgGraph, true, subQueryLinkedList, lastOfPrevious, null, leftJoinOn, false);
              } else {
                  sql = constructSinglePathSql(sqlgGraph, true, subQueryLinkedList, lastOfPrevious, firstOfNext);
              }
              singlePathSql.append(sql);
              if (count == 1) {
                  singlePathSql.append("\n) a").append(count++).append(" INNER JOIN (");
              } else {
                  //join the last with the first
                  singlePathSql.append("\n) a").append(count).append(" ON ");
                  singlePathSql.append(constructSectionedJoin(sqlgGraph, lastOfPrevious, firstSchemaTableTree, count));
                  if (count++ < subQueryLinkedLists.size()) {
                      singlePathSql.append(" INNER JOIN (");
                  }
              }
              lastOfPrevious = subQueryLinkedList.getLast();
          }
          singlePathSql.append(constructOuterOrderByClause(sqlgGraph, subQueryLinkedLists));
          String result = "SELECT\n\t" + constructOuterFromClause(subQueryLinkedLists);
          return result + singlePathSql;
      }
docs: Construct a sql statement for one original path to a leaf node.
  As the path contains the same label more than once its been split into a List of Stacks.