创建一个新的有序的集合
利用Stream.iterate方法
List<Integer> years = Stream.iterate(LocalDate.now().getYear(), (x) -> x + 1).limit(50).collect(Collectors.toList());
years.forEach(System.out::println);
利用Stream.iterate方法
List<Integer> years = Stream.iterate(LocalDate.now().getYear(), (x) -> x + 1).limit(50).collect(Collectors.toList());
years.forEach(System.out::println);