移除List中所有某个值

解决方法

例:删除list test中的null值

1
2
3
List<String> test = new ArrayList<>();
   test.removeAll(Collections.singleton(null));