@Test
    public void testRetainAll() {
        assertEquals(Arrays.asList(2, 3, 2), Seq.of(1, 2, 3, 2, 4).retainAll(2, 3).toList());
        assertEquals(Arrays.asList(2, 2), Seq.of(1, 2, 3, 2, 4).retainAll(2, 3).retainAll(2).toList());
        assertEquals(Arrays.asList(), Seq.of(1, 2, 3, 2, 4).retainAll(5).toList());
        assertEquals(Arrays.asList(), Seq.of(1, 2, 3, 2, 4).retainAll((Integer) null).toList());

        verifyIteratorValidity(3, Seq.of(1, 2, 3), seq -> seq.retainAll(2));
    }
@author Lukas Eder
@author Roman Tkalenko
jOOL/src/test/java/org/jooq/lambda/SeqTest.java