how to clear the list using remove if in java 8 code example Example: java remove List null element dataList.removeAll(Collections.singleton(null));