public static <EdgeType> List<EdgeType> getEdges(
      final IEdgeIterableGraph<EdgeType> graph, final INodeFilter<EdgeType> filter) {
    Preconditions.checkNotNull(graph, "Error: Graph argument can't be null");
    Preconditions.checkNotNull(filter, "Error: Filter argument can't be null");
    final ArrayList<EdgeType> nodes = new ArrayList<EdgeType>();

    graph.iterateEdges(
        new IEdgeCallback<EdgeType>() {
          @Override
          public IterationMode nextEdge(final EdgeType node) {
            if (filter.qualifies(node)) {
              nodes.add(node);
            }

            return IterationMode.CONTINUE;
          }
        });

    return nodes;
  }
Returns a list of nodes that match the given filter.

@param <NodeType> Type of the nodes in the graph.
@param graph The graph that provides the nodes.
@param filter The filter that selects the nodes.
@return The list of nodes that passes the filter.
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/zygraph/helpers/GraphHelpers.java