xxxxxxxxxx
LocalDateTime lastDayOfPrevYear = LocalDateTime.now().minusYears(1).with(TemporalAdjusters.lastDayOfYear());
xxxxxxxxxx
LocalDate now = LocalDate.now();
LocalDate lastDay = now.with(TemporalAdjusters.lastDayOfMonth());
xxxxxxxxxx
Calendar cal = Calendar.getInstance();
cal.set(Calendar.DATE, cal.getActualMaximum(Calendar.DATE));
Date lastDayOfMonth = cal.getTime();