I have a list object type and I want to sort it by date in ascending order. First of all I get the resevations that are between these dates and saving it to a new List. Now I need someway to sort it. I tried Collections.sort(reservationsByDate) & Collections.sort(reservationsByDate, Collections.reverseSort() , but it didn't produce anything. I'm kinda new to java so if theres something that im missing please help me implement this.
heres my code:
public List<Reservation> getAllReservationsSortedByDate(LocalDate from, LocalDate to) {
    int fromDate = from.getDayOfMonth();
    int toDate = to.getDayOfMonth();
    ArrayList<Reservation> reservationsByDate = new ArrayList<>();
    for (Reservation reservation : reservations) {
        if (reservation.getFromDate().getDayOfMonth() >= fromDate && reservation.getToDate().getDayOfMonth() <= toDate) {
            reservationsByDate.add(reservation);
        }
    }
    //reservationsByDate needs to be sorted by dates in ascending order...
    return reservationsByDate;
}
Thank you for your help.