@Test
    public void testIterator() throws Exception {

        Object domainNode1 = new Object();
        Object domainNode2 = new Object();
        Object domainNode3 = new Object();

        InternalNode<Object, Object> node1 = (InternalNode<Object, Object>) Mockito.mock(InternalNode.class);
        Mockito.when(node1.getWrappedNode()).thenReturn(domainNode1);
        InternalNode<Object, Object> node2 = (InternalNode<Object, Object>) Mockito.mock(InternalNode.class);
        Mockito.when(node2.getWrappedNode()).thenReturn(domainNode2);
        InternalNode<Object, Object> node3 = (InternalNode<Object, Object>) Mockito.mock(InternalNode.class);
        Mockito.when(node3.getWrappedNode()).thenReturn(domainNode3);
        List<Object> domainNodes = Arrays.asList(domainNode1, domainNode2, domainNode3);

        BasicPredGraph<Object, Object> basicPredGraph1 = new BasicPredGraph<Object, Object>(node1, 42);
        BasicPredGraph<Object, Object> basicPredGraph2 = new BasicPredGraph<Object, Object>(node2, 43);
        BasicPredGraph<Object, Object> basicPredGraph3 = new BasicPredGraph<Object, Object>(node3, 44);

        basicPredGraph1.setPredecessor(basicPredGraph2).setPredecessor(basicPredGraph3);

        Iterator<InternalNode<Object, Object>> it = basicPredGraph1.iterator();
        int i = 0;
        for (; it.hasNext(); i++) {
            Object obj = it.next().getWrappedNode();
            Assert.assertEquals(domainNodes.get(i), obj);
        }

        Assert.assertEquals(i, domainNodes.size());

        try {
            it.next();
            Assert.fail("Expected exception not thrown.");
        } catch (NoSuchElementException e) {
            ; // do nothing
        }

        try {
            it.remove();
            Assert.fail("Expected exception not thrown.");
        } catch (UnsupportedOperationException e) {
            ; // do nothing
        }
    }