@Test
    public void testUnfold() {
        // Workaround for Eclipse bug: Explicit argument typing:
        // https://bugs.eclipse.org/bugs/show_bug.cgi?id=460517
        assertEquals(
            asList(0, 1, 2, 3, 4),
            Seq.unfold(0, (Integer i) -> i < 5 ? Optional.of(tuple(i, i + 1)) : Optional.empty()).toList());

        // Workaround for Eclipse bug: Explicit argument typing:
        // https://bugs.eclipse.org/bugs/show_bug.cgi?id=460517
        assertEquals(
            asList('a', 'b', 'c', 'd', 'e'),
            Seq.unfold(0, (Integer i) -> i < 5 ? Optional.of(tuple((char) ('a' + i), i + 1)) : Optional.empty()).toList());
        
        Seq<Object> result = Seq.unfold(0, i -> Optional.of(tuple("a", i + 1)));
    }
@author Lukas Eder
@author Roman Tkalenko
jOOL-java-8/src/test/java/org/jooq/lambda/SeqTest.java