Code example for TreeMap

Methods: containsKeytailMap

     *	Returns the least key greater than or equal to the given key,  
     *	or null if there is no such key. 
    final Integer ceilingKey(Integer time) {
    	if(events.containsKey(time)) {
    		return time;
    	SortedMap<Integer, Event> map = events.tailMap(time);    	
    	return map.isEmpty() ? null : map.firstKey();  
Connect your IDE to all the code out there  Get Codota for Java