public static <NodeType extends IGraphNode<NodeType> & ISelectableNode> void expandSelectionDown(
      final ISelectableGraph<NodeType> graph) {
    Preconditions.checkNotNull(graph, "Error: Graph argument can't be null");
    final ArrayList<NodeType> toSelect = new ArrayList<NodeType>();
    final INodeFilter<NodeType> deselectedFilter = StandardFilters.getDeselectedFilter();

    // Collect all the nodes that must be selected
    graph.iterateSelected(
        new INodeCallback<NodeType>() {
          @Override
          public IterationMode next(final NodeType node) {
            toSelect.addAll(GraphAlgorithms.collectChildren(node, deselectedFilter));

            return IterationMode.CONTINUE;
          }
        });

    graph.selectNodes(toSelect, true);
  }
Expands the current selection down. This means that all children of the currently selected
nodes are selected too.

@param <NodeType> The node type of all nodes in the graph.
@param graph The graph where the current selection is expanded.
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/zygraph/helpers/GraphHelpers.java