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

            private boolean doneDone = false;

            @Override
            public Integer tryNext() {
                if (doneDone) {
                    fail("Should not be called again");
                }
                doneDone = true;
                return done();
            }
        };

        assertTrue("should not has next", !it.hasNext());

        try {
            it.current();
            fail("should throw");
        } catch (NoSuchElementException expected) {
            expected.getCause();
        }

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