@Test
    public void testOnEmpty() throws X {
        assertEquals(asList(1), Seq.of().onEmpty(1).toList());
        assertEquals(asList(1), Seq.of().onEmptyGet(() -> 1).toList());
        assertThrows(X.class, () -> Seq.of().onEmptyThrow(() -> new X()).toList());
        verifyIteratorValidity(0, Seq.of(), seq -> seq.onEmpty(1));

        assertEquals(asList(2), Seq.of(2).onEmpty(1).toList());
        assertEquals(asList(2), Seq.of(2).onEmptyGet(() -> 1).toList());
        assertEquals(asList(2), Seq.of(2).onEmptyThrow(() -> new X()).toList());
        verifyIteratorValidity(1, Seq.of(2), seq -> seq.onEmpty(1));

        assertEquals(asList(2, 3), Seq.of(2, 3).onEmpty(1).toList());
        assertEquals(asList(2, 3), Seq.of(2, 3).onEmptyGet(() -> 1).toList());
        assertEquals(asList(2, 3), Seq.of(2, 3).onEmptyThrow(() -> new X()).toList());
        verifyIteratorValidity(2, Seq.of(2, 3), seq -> seq.onEmpty(1));
    }
@author Lukas Eder
@author Roman Tkalenko
jOOL-java-8/src/test/java/org/jooq/lambda/SeqTest.java