I am trying to sort the following class:
public class Request {
    private String id;
    private String name;
    private List<RequestType> requestTypes;
}
public class RequestType {
    private String name;
    private String value;
    private RequestTypeEnum requestTypeEnum;
    private long date;
    private boolean done;
    private int priority;
    private String id;
}
The request class needs to be ordered based on the data from the requestTypes property. How would I go about approaching this problem
I started by doing nested for loops:
 for(int i= 0;  i< requests.size(); i++) {
        Request request = requests.get(i);
        for(int j = 0; j < request.getRequestTypes().size();j++) {
        }
    } 
Not sure what I need to do from there it needs to be ordered by the date field in ascending order.
