code: private DependencyTreeNode getNextNode(DependencyRelation prev,
                                             DependencyRelation cur) {
          return (prev.headNode() == cur.headNode() 
                  || prev.dependentNode() ==  cur.headNode())
              ? cur.dependentNode()
              : cur.headNode();
      }
docs: Given the nodes in the previous relation, determine which of the nodes in
  the next relation is new and return that.
  
  @param prev the dependency relation that was previously seen in the path
  @param cur the current dependency relation