Code example for ConcurrentHashMap

Methods: values

0
	public void ackMessage(Message message) {
		log.remove(message);
	} 
 
	public List<Message> getUnackedMessages() {
		List<Message> unacked = new ArrayList<Message>(log.values());
		Collections.sort(unacked, new TimeComperator());
		return unacked;
	} 
 
	private class TimeComperator implements Comparator<Message> {
 
		public int compare(Message arg0, Message arg1) {
			Long t1 = arg0.getMessageId().timestamp();
			return t1.compareTo(arg1.getMessageId().timestamp());
		} 
		 
	} 
	 
}