Populating a List with a contiguous range of integers April 22, 2023 by Tarik The new, Java 8 way: List<Integer> range = IntStream.range(1, 501).boxed().collect(Collectors.toList());