public class FriendModel {
@SerializedName("email")
@Expose
private String email;
@SerializedName("name")
@Expose
private String name;
@SerializedName("userid")
@Expose
private String userid;
@SerializedName("photourl")
@Expose
private String photourl;
@SerializedName("messages")
@Expose
private List<Message> messages = null;
}
I am using firebaserecycler adapter that populates FriendModel in a list.
In each object of the FriendModel list, I have another list which is List of Message. What I want is to get the last item of this Message list.I have to show the last item in my same adapter. Is there any way to add this limitation to my List. My List of Message can be very long can contains tons of items so I don't want to hold all objects in my Message list that's why I need to do this. Any help would be appreciated...

