public static List<Integer> sequence(final int start, int end, final int step) {

        final int size = (end - start) / step;
        if (size < 0)  throw new IllegalArgumentException("List size is negative");

        return new AbstractList<>() {
            @Override
            public Integer get(int index) {
                if (index < 0 || index >= size)
                    throw new IndexOutOfBoundsException();
                return start + index * step;
            }

            @Override
            public int size() {
                return size;
            }
        };
    }
@Test
    public void sequence() {
        List<Integer> lst = Iterators.sequence(1, 4);
        assertEquals(1, (int) lst.get(0));
        assertEquals(2, (int) lst.get(1));
        assertEquals(3, (int) lst.get(2));
        assertEquals(3, lst.size());
    }