    @Test
    public void testLimit() {

        CloseableIterator<Integer> firstThree = limit(testIterator(), 3);

        assertTrue(elementsEqual(asList(1, 2, 3).iterator(), firstThree));
        assertFalse(firstThree.hasNext());
        firstThree.close();
    }