I have a list:
List<A> aList
where A:
public class A{
private Long id;
private LocalDate created;
private AStatus status; //enum
...other fields
}
public enum AStatus{
NEW, SEND, WAITING, CANCELLED
}
How to sort my List FIRST by created
in DESC order and then I want to have elements with the status NEW
as first (and then elements with other AStatus
), like:
1 10.12.2020 NEW
2 10.12.2020 SEND
3 10.12.2020 CANCELLED
4 08.12.2020 NEW
5 08.12.2020 NEW