Good day!
There is a class of Chat:
public class Chat { private String id; private String title; private String author; private String[] participants; private String lastMessage; private long created; private long updated; } There is a list:
ArrayList<Chat> chats = new ArrayList<Chat>(); The list contains several objects.
You must sort this list by updated field descending.
How to do it right?