@Override
    public Iterator<Path> getPathIterator() {
        return new Iterator<Path>() {

            private boolean[] bits = new boolean[8];
            private int current = 0;

            @Override
            public boolean hasNext() {
                return current < 8 && !bits[current];
            }

            @Override
            public Path next() {
                try {
                    bits[current] = true;
                    bits[exits.get(current)] = true;
                    return new Path(Arrays.asList(current, exits.get(current)), accessed.get(current));
                } finally {
                    while ((++current) < 8 && bits[current]) ;
                }

            }

            @Override
            public void remove() {
                throw new UnsupportedOperationException();
            }
        };
    }