code: public Node createNode(final String name, final NodeProcessor nodeProcessor) {
      checkIsBuilt();
  
      if (this.nameToNodeMap.get(name) != null) {
        throw new DagException(String.format("Node names in %s need to be unique. The name "
            + "(%s) already exists.", this, name));
      }
      final Node node = new Node(name, nodeProcessor, this.dag);
      this.nameToNodeMap.put(name, node);
  
      return node;
    }
docs: Creates a new node and adds it to the DagBuilder.
  
  @param name name of the node
  @param nodeProcessor node processor associated with this node
  @return a new node
  @throws DagException if the name is not unique in the DAG.