remove nulls from list code example
Example 1: java remove List null element
dataList.removeAll(Collections.singleton(null));
Example 2: how to remove null values collections
2. HOW TO REMOVE NULL VALUES
List<String> list = new ArrayList
(Arrays.asList("Java",null,"Python",null, "Ruby"));
CollectionUtils.filter(list, PredicateUtils.notNullPredicate());
==> removes nulls
System.out.println(list);