先看使用方式
List<Integer> list = Lists.newArrayList(1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 9, 9, 9, 1, 2, 3, 2, 3, 4); String[] strings = Flow.of(list) .filter(x -> x % 2 == 0) .map(x -> x + "s") .limit(30) .skip(1) .distinct() .sorted(Comparator.reverseOrder()) .toArray(String[]::new); ///[8s, 6s, 4s, 2s] System.out.println(Arrays.toString(strings));