private static List<Edge> getEdgesToBeDeleted(final Graph2D graph, final GraphBuilder graphBuilder, final DeleteProvider deleteProvider) {
List<Edge> toBeDeleted = new ArrayList<Edge>();
for (EdgeCursor edgeCursor = graph.selectedEdges(); edgeCursor.ok(); edgeCursor.next()) {
final Edge edge = edgeCursor.edge();
final Object edgeObject = graphBuilder.getEdgeObject(edge);
if (edgeObject != null && deleteProvider.canDeleteEdge(edgeObject)) {
toBeDeleted.add(edge);
}