public final N adjacentNode(Object node) {
    if (node.equals(myNodeU)) {
      return myNodeV;
    }
    else if (node.equals(myNodeV)) {
      return myNodeU;
    }
    else {
      throw new IllegalArgumentException("EndpointPair " + this + " does not contain node " + node);
    }
  }
public final N adjacentNode(Object node)