public void selectNodes(
      final Collection<NodeType> toSelect, final Collection<NodeType> toUnselect) {
    m_graph.firePreEvent();

    for (final NodeType node : toSelect) {
      Preconditions.checkNotNull(
          node, "Error: The list of nodes to select contained an invalid node");

      ((IViewNode<?>) node.getRawNode()).setSelected(true);
    }

    for (final NodeType node : toUnselect) {
      Preconditions.checkNotNull(
          node, "Error: The list of nodes to unselect contained an invalid node");

      ((IViewNode<?>) node.getRawNode()).setSelected(false);
    }

    m_graph.firePostEvent();
  }
Selects a list of nodes and unselects another list of nodes.

@param toSelect The list of nodes to select.
@param toUnselect The list of nodes to unselect.
java/zylib/src/main/java/com/google/security/zynamics/zylib/yfileswrap/gui/zygraph/AbstractZyGraph.java