    @Test
    void test() {

        assertEquals(asList(asList("Foo", "Bar", "ON"), asList("OFF", "was")),
                partition(
                        Stream.of("Foo", "Bar", "ON", "Fire", "OFF", "was", "destroyed"),
                        s -> s.length() > 3)
                                .collect(Collectors.toList()));

        assertEquals(asList(asList("Foo", "Bar", "OFF", "Fire", "OFF", "was")),
                partition(
                        Stream.of("Foo", "Bar", "OFF", "Fire", "OFF", "was", "destroyed"),
                        s -> s.length() > 4)
                                .collect(Collectors.toList()));

        assertEquals(asList(asList(), asList(), asList("ON"), asList("ON"), asList()),
                partition(
                        Stream.of("Foo", "Bar", "ON", "Fire", "ON", "was", "destroyed"),
                        s -> s.length() > 2)
                                .collect(Collectors.toList()));
    }