java
List<Entity> baseMess = new ArrayList<>();
baseMess= motiveService.getBaseMessage(machine.get(i),preDate,nowDate);
System.out.println("获取Size"+baseMess.size());
baseMess.removeIf(Objects::isNull);
System.out.println("获取Size"+baseMess.size());
list为null时结果:
list不为null时结果:
baseMess.removeIf(Objects::isNull);