code: @SuppressWarnings("unchecked")
    <T extends GraphNode<N, E>> T getNodeOrFail(N val) {
      T node = (T) getNode(val);
      if (node == null) {
        throw new IllegalArgumentException(val + " does not exist in graph");
      }
      return node;
    }
docs: Gets the node of the specified type, or throws an
  IllegalArgumentException.