@Test
    public void testGroupedWithCollector() throws Exception {
        List<Tuple2<Integer, List<Integer>>> l1 =
        Seq.of(1, 2, 3, 4)
           .grouped(x -> x % 2, Collectors.toList())
           .toList();

        assertEquals(asList(
            Tuple.tuple(1, Arrays.asList(1, 3)),
            Tuple.tuple(0, Arrays.asList(2, 4))
        ), l1);


        List<Tuple2<Integer, String>> l2 =
        Seq.of(1, 2, 3, 4)
           .grouped(x -> x % 2, Collectors.mapping(Object::toString, Collectors.joining(", ")))
           .toList();

        assertEquals(asList(
            Tuple.tuple(1, "1, 3"),
            Tuple.tuple(0, "2, 4")
        ), l2);
    }
@author Lukas Eder
@author Roman Tkalenko
jOOL-java-8/src/test/java/org/jooq/lambda/SeqTest.java