private void updateNodeToEdgeMapping(final EdgeType edge) {
    Preconditions.checkNotNull(edge, "Error: edge argument can not be null");

    if (m_nodeToEdges.get(edge.getSource()) != null) {
      m_nodeToEdges.get(edge.getSource()).add(edge);
    } else {
      throw new IllegalStateException(
          "Error: The given edge has a source node which is not known to the graph.");
    }
    if (m_nodeToEdges.get(edge.getTarget()) != null) {
      m_nodeToEdges.get(edge.getTarget()).add(edge);
    } else {
      throw new IllegalStateException(
          "Error: the given edge has a target node which is not known to the graph.");
    }
  }
Creates a new mutable directed graph.

@param nodes The nodes of the graph.
@param edges The edges of the graph.
java/zylib/src/main/java/com/google/security/zynamics/zylib/types/graphs/MutableDirectedGraph.java