Code example for TreeMap

Methods: lastKey

	 * @return map.entry 
	public Entry<Integer, Event> getNextEvent(int time) {
		// last key? 
		if (time > events.lastKey()) return null;
		HashMap<Integer, Event> map = new HashMap<Integer, Event>(1);
		map.put(ceilingKey(time), events.get(ceilingKey(time)));
		return map.entrySet().iterator().next();
	 * returns the entry set itself 
	 * @return Set<Map.Entry<Integer,Event>> set of events 
	public Set<Map.Entry<Integer,Event>> getEntrySet() {
		return events.entrySet();
Connect your IDE to all the code out there  Get Codota for Java