List sourceEdges = (List)startNodesList.get(edge.getStartNode()); List targetEdges = (List)targetNodesList.get(edge.getTargetNode()); sourceEdges.add(edge); listeners.firePropertyChange(ID_SOURCE_CHANGED, null, edge); targetEdges.add(edge); listeners.firePropertyChange(ID_TARGET_CHANGED, null, edge); return edge;
List sourceEdges = getSourceEdges(startNode); if (! containsEdge(sourceEdges, targetNode, type)) { Edge newEdge = new Edge(startNode, targetNode, type, number);  sourceEdges.add(newEdge); listeners.firePropertyChange(ID_SOURCE_CHANGED, null, newEdge);   getTargetEdges(targetNode).add(newEdge); listeners.firePropertyChange(ID_TARGET_CHANGED, null, newEdge); logger.debug("Edge added: " + newEdge); return newEdge; } return null;
    public Edge addEdge(Edge edge) {        if (containsEdge(edge.getStartNode(), edge.getTargetNode(), edge.getType())) {            return null;        }        List sourceEdges = (List)startNodesList.get(edge.getStartNode());        List targetEdges = (List)targetNodesList.get(edge.getTargetNode());        sourceEdges.add(edge);        listeners.firePropertyChange(ID_SOURCE_CHANGED, null, edge);        targetEdges.add(edge);        listeners.firePropertyChange(ID_TARGET_CHANGED, null, edge);        return edge;    }