Code example for TreeSet

Methods: first

0
		return added;
	} 
	 
	public int getLastMessageId(){ 
		try{ 
			return recentMessages.first().getId();
		}catch(Exception e){
			return 0; 
		} 
	} 
	 
	public TreeSet<ChatMessage> getMessages(){
		return recentMessages;
	} 
	 
	@Override 
	public int compareTo(Room another) {
		return this.getId().compareTo(another.getId());
	} 
}