@Test
    public void testConcat() {
        assertEquals(asList(1, 2, 3, 4), Seq.of(1).concat(Seq.of(2, 3, 4)).toList());
        assertEquals(asList(1, 2, 3, 4), Seq.of(1, 2).concat(Seq.of(3, 4)).toList());
        assertEquals(asList(1, 2, 3, 4), Seq.of(1).concat(2, 3, 4).toList());
        assertEquals(asList(1, 2, 3, 4), Seq.of(1, 2).concat(3, 4).toList());
        
        assertEquals(asList(1, 2, 3), Seq.of(1, 2, 3).concat(Optional.empty()).toList());
        assertEquals(asList(1, 2, 3, 4), Seq.of(1, 2, 3).concat(Optional.of(4)).toList());
        
        assertEquals(asList(1, 2, 3), Seq.of(1, 2, 3).prepend(Optional.empty()).toList());
        assertEquals(asList(0, 1, 2, 3), Seq.of(1, 2, 3).prepend(Optional.of(0)).toList());
        
        assertEquals(asList(1, 2), Seq.concat(Optional.of(1), Optional.empty(), Optional.of(2), Optional.empty()).toList());

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