@Test
    public void testCollect() {
        assertEquals(
            tuple(0L, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()),
            Seq.<Integer>of().collect(count(), min(), min(i -> -i), max(), max(i -> -i))
        );

        assertEquals(
            tuple(1L, Optional.of(1), Optional.of(-1), Optional.of(1), Optional.of(-1)),
            Seq.of(1).collect(count(), min(), min(i -> -i), max(), max(i -> -i))
        );

        assertEquals(
            tuple(2L, Optional.of(1), Optional.of(-2), Optional.of(2), Optional.of(-1)),
            Seq.of(1, 2).collect(count(), min(), min(i -> -i), max(), max(i -> -i))
        );

        assertEquals(
            tuple(3L, Optional.of(1), Optional.of(-3), Optional.of(3), Optional.of(-1)),
            Seq.of(1, 2, 3).collect(count(), min(), min(i -> -i), max(), max(i -> -i))
        );

        assertEquals(
            tuple(4L, Optional.of(1), Optional.of(-4), Optional.of(4), Optional.of(-1)),
            Seq.of(1, 2, 3, 4).collect(count(), min(), min(i -> -i), max(), max(i -> -i))
        );
        
        assertEquals(
            asList("a", "b", "c"),
            Seq.of("a", "b", "c").collect(Collectors.toList())
        );
    }
@author Lukas Eder
@author Roman Tkalenko
jOOL/src/test/java/org/jooq/lambda/SeqTest.java