@Test
public void testUndirectedIterator() {

    EdgeStore edgeStore = new EdgeStore();
    EdgeImpl[] edges = GraphGenerator.generateSmallEdgeList();
    edgeStore.addAll(Arrays.asList(edges));
    ObjectSet<EdgeImpl> edgeSet = new ObjectOpenHashSet<EdgeImpl>();
    for (EdgeImpl e : edges) {
        if (e.isSelfLoop() || !e.isMutual() || e.source.storeId > e.target.storeId) {
            edgeSet.add(e);
        }
    }
    EdgeStore.EdgeStoreIterator undirectedIterator = edgeStore.iteratorUndirected();
    for (; undirectedIterator.hasNext();) {
        EdgeImpl e = undirectedIterator.next();
        Assert.assertTrue(edgeSet.remove(e));
    }
    Assert.assertEquals(0, edgeSet.size());
}