@Test
    public void testCommonIteration() {
        Iterator<Integer> it = new TryIterator<Integer>() {

            private int count = 0;

            @Override
            protected Integer tryNext() {
                switch (count++) {
                    case 0:
                        return 0;
                    case 1:
                        return 1;
                    case 2:
                        return done();
                    default:
                        fail("Should not reach here");
                }
                return null;
            }
        };

        assertTrue("has next", it.hasNext());
        assertEquals("next", 0, (int) it.next());

        assertTrue("has next", it.hasNext());
        assertTrue("has next", it.hasNext()); // should be idempotent

        assertEquals("current", 1, (int) ((TryIterator<Integer>) it).current());
        assertEquals("current 1", 1, (int) ((TryIterator<Integer>) it).current());
        assertEquals("next", 1, (int) it.next());

        assertTrue("no next", !it.hasNext());
        assertTrue("no next", !it.hasNext()); // ditto

        try {
            it.next();
            fail("Should throw exception");
        } catch (NoSuchElementException expected) {
            expected.getCause();
        }
    }