List<List<Integer>> list = new ArrayList<>();
        list.add(Arrays.asList(new Integer[]{1,2}));
        list.add(Arrays.asList(new Integer[]{3,4}));
        list.add(null);
        list.add(Arrays.asList(new Integer[]{4,3,5}));
        List<Integer> result = list.stream()
                .filter(item-> item != null)
                .reduce(new ArrayList<>(), (all, item ) -> {all.addAll(item); return all;});
        System.out.println(result);

 

相关文章:

  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
  • 2021-05-08
  • 2022-12-23
  • 2021-12-03
猜你喜欢
  • 2021-08-23
  • 2021-08-04
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
相关资源
相似解决方案