@Override
    public void removeEdge(EdgeDraft edgeDraft) {
        checkElementDraftImpl(edgeDraft);

        EdgeDraftImpl edgeDraftImpl = (EdgeDraftImpl) edgeDraft;
        String id = edgeDraftImpl.getId();

        if (!edgeMap.containsKey(id)) {
            return;
        }

        final boolean directed = isEdgeDirected(edgeDraftImpl);

        if (directed) {
            directedEdgesCount--;
        } else {
            undirectedEdgesCount--;
        }

        if (edgeDraftImpl.isSelfLoop()) {
            selfLoops--;
        }

        int edgeType = getEdgeType(edgeDraftImpl.getType());
        long sourceTargetLong = getLongId(edgeDraftImpl);
        ensureLongSetArraySize(edgeType);
        Long2ObjectMap<int[]> edgeTypeSet = edgeTypeSets[edgeType];

        //Get index
        final int index = edgeMap.removeInt(id);

        //Update edgeType set
        int[] edges = edgeTypeSet.remove(sourceTargetLong);
        if (Arrays.binarySearch(edges, index) >= 0) {
            if (edges.length > 1) {
                int[] newEdges = new int[edges.length - 1];
                int i = 0;
                for (int e : edges) {
                    if (e != index) {
                        newEdges[i++] = e;
                    }
                }
                edgeTypeSet.put(sourceTargetLong, newEdges);
            } else {
                edgeTypeSet.put(sourceTargetLong, new int[0]);
            }
        }

        //Remove edge
        edgeList.set(index, null);
    }
@Test
    public void testRemoveEdge() {
        ImportContainerImpl importContainer = new ImportContainerImpl();
        generateTinyGraph(importContainer);
        importContainer.removeEdge(importContainer.getEdge("1"));

        Assert.assertTrue(importContainer.verify());
        Assert.assertEquals(1, importContainer.getUnloader().getEdgeCount());
    }