code: @Override
    public boolean addDataNode(DataNode node) {
      try {
        rwLock.writeLock().lock();
        //Get edges adjacent to the node if it already exists
        Set<FlowEdge> edges = this.nodesToEdges.getOrDefault(node, new HashSet<>());
        this.nodesToEdges.put(node, edges);
        this.dataNodeMap.put(node.getId(), node);
      } finally {
        rwLock.writeLock().unlock();
      }
      return true;
    }
docs: Add a {@link DataNode} to the {@link FlowGraph}. If the node already "exists" in the {@link FlowGraph} (i.e. the
  FlowGraph already has another node with the same id), we remove the old node and add the new one. The
  edges incident on the old node are preserved.
  @param node to be added to the {@link FlowGraph}
  @return true if node is successfully added to the {@link FlowGraph}.