code: private boolean addNodeIfNotAlreadyIncluded(T thisImport,
        LinkedList<T> imports, Set<T> alreadyIncludedImports) {
      if (alreadyIncludedImports.contains(thisImport)) {
        return false;
      }
      imports.add(thisImport);
      alreadyIncludedImports.add(thisImport);
      return true;
    }
docs: Only add node to traversal if it is not already included in it.