List移除前几个元素
planDetailsEntities.subList(0, 6).clear();
List根据属性 去除重复值
//月份去重
ArrayList<PlanDetailsEntity> detailsEntities = planDetailsEntities.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(() ->
new TreeSet<>(Comparator.comparing(PlanDetailsEntity::
getPlandueDate))), ArrayList::new));
计算两个日期计算相差的月份
Temporal temporal1 = LocalDate.parse(this.plandueDate);
Temporal temporal2 = LocalDate.parse(SDF.format(paymentPlansDate));
return Integer.parseInt(String.valueOf(ChronoUnit.MONTHS.between(temporal2,temporal1)));