@Test
    public void testRange() {
        assertEquals(Arrays.asList(), Seq.range((byte) 0, (byte) -1).toList());
        assertEquals(Arrays.asList(), Seq.range((byte) 0, (byte) 0).toList());
        assertEquals(Arrays.asList((byte) 0), Seq.range((byte) 0, (byte) 1).toList());
        assertEquals(Arrays.asList((byte) 0, (byte) 1), Seq.range((byte) 0, (byte) 2).toList());
        assertEquals(Arrays.asList((byte) 0, (byte) 2), Seq.range((byte) 0, (byte) 4, 2).toList());
        assertEquals(Arrays.asList((byte) 0, (byte) 2, (byte) 4), Seq.range((byte) 0, (byte) 5, 2).toList());

        assertEquals(Arrays.asList(), Seq.range((short) 0, (short) -1).toList());
        assertEquals(Arrays.asList(), Seq.range((short) 0, (short) 0).toList());
        assertEquals(Arrays.asList((short) 0), Seq.range((short) 0, (short) 1).toList());
        assertEquals(Arrays.asList((short) 0, (short) 1), Seq.range((short) 0, (short) 2).toList());
        assertEquals(Arrays.asList((short) 0, (short) 2), Seq.range((short) 0, (short) 4, 2).toList());
        assertEquals(Arrays.asList((short) 0, (short) 2, (short) 4), Seq.range((short) 0, (short) 5, 2).toList());

        assertEquals("", Seq.range('B', 'A').toString());
        assertEquals("", Seq.range('B', 'B').toString());
        assertEquals("A", Seq.range('A', 'B').toString());
        assertEquals("AB", Seq.range('A', 'C').toString());
        assertEquals("AC", Seq.range('A', 'E', 2).toString());
        assertEquals("ACE", Seq.range('A', 'F', 2).toString());

        assertEquals(Arrays.asList(), Seq.range(0, -1).toList());
        assertEquals(Arrays.asList(), Seq.range(0, 0).toList());
        assertEquals(Arrays.asList(0), Seq.range(0, 1).toList());
        assertEquals(Arrays.asList(0, 1), Seq.range(0, 2).toList());
        assertEquals(Arrays.asList(0, 2), Seq.range(0, 4, 2).toList());
        assertEquals(Arrays.asList(0, 2, 4), Seq.range(0, 5, 2).toList());

        assertEquals(Arrays.asList(), Seq.range(0L, -1L).toList());
        assertEquals(Arrays.asList(), Seq.range(0L, 0L).toList());
        assertEquals(Arrays.asList(0L), Seq.range(0L, 1L).toList());
        assertEquals(Arrays.asList(0L, 1L), Seq.range(0L, 2L).toList());
        assertEquals(Arrays.asList(0L, 2L), Seq.range(0L, 4L, 2).toList());
        assertEquals(Arrays.asList(0L, 2L, 4L), Seq.range(0L, 5L, 2).toList());

        assertEquals(
            Arrays.asList(),
            Seq.range(Instant.ofEpochSecond(0L), Instant.ofEpochSecond(-1L)).toList());
        assertEquals(
            Arrays.asList(),
            Seq.range(Instant.ofEpochSecond(0L), Instant.ofEpochSecond(0L)).toList());
        assertEquals(
            Arrays.asList(Instant.ofEpochSecond(0L)),
            Seq.range(Instant.ofEpochSecond(0L), Instant.ofEpochSecond(1L)).toList());
        assertEquals(
            Arrays.asList(Instant.ofEpochSecond(0L), Instant.ofEpochSecond(1L)),
            Seq.range(Instant.ofEpochSecond(0L), Instant.ofEpochSecond(2L)).toList());
        assertEquals(
            Arrays.asList(Instant.ofEpochSecond(0L), Instant.ofEpochSecond(2L)),
            Seq.range(Instant.ofEpochSecond(0L), Instant.ofEpochSecond(4L), Duration.ofSeconds(2)).toList());
        assertEquals(
            Arrays.asList(Instant.ofEpochSecond(0L), Instant.ofEpochSecond(2L), Instant.ofEpochSecond(4L)),
            Seq.range(Instant.ofEpochSecond(0L), Instant.ofEpochSecond(5L), Duration.ofSeconds(2)).toList());
    }
@author Lukas Eder
@author Roman Tkalenko
jOOL-java-8/src/test/java/org/jooq/lambda/SeqTest.java