@SuppressWarnings("unchecked")
  public static <NodeType extends IGraphNode<NodeType>> Set<NodeType> getPredecessorsUpToNode(
      final IGraphNode<NodeType> childNode, final IGraphNode<NodeType> maximumParentNode) {

    Preconditions.checkNotNull(childNode, "Error: endNode argument can not be null");
    Preconditions.checkNotNull(maximumParentNode, "Error: startNode argument can not be null");

    final HashSet<NodeType> predecessors = Sets.newHashSet();
    final HashSet<NodeType> visited = Sets.newHashSet();
    visited.add((NodeType) maximumParentNode);

    getPredecessors(childNode, predecessors, visited);

    return predecessors;
  }
Finds all predecessors of a node. Those are all the nodes that have a direct or indirect path
to the node.

@param <NodeType> The type parameter that specifies the type of the nodes in the graph.
@param node The start node.
@return A list containing all predecessor nodes of the node.
java/zylib/src/main/java/com/google/security/zynamics/zylib/types/graphs/GraphAlgorithms.java