code: private void initializeQueue() {
          this.queue.clear();
          for (Map.Entry<String, NodeT> entry: nodeTable.entrySet()) {
              if (!entry.getValue().hasDependencies()) {
                  this.queue.add(entry.getKey());
              }
          }
          if (queue.isEmpty()) {
              throw new IllegalStateException("Detected circular dependency");
          }
      }
docs: Initializes the queue that tracks the next set of nodes with no dependencies or
  whose dependencies are resolved.