NavigableMap: ceilingKey(T key)

K ceilingKey(K key)
Returns the least key greater than or equal to the given key.
import java.util.Calendar;
import java.util.Locale;
import java.util.Map;
import java.util.NavigableMap;
import java.util.TreeMap;

public class Main {
  public static void main(String args[]) {
    Calendar now = Calendar.getInstance();
    Locale locale = Locale.getDefault();

    Map<String, Integer> names = now.getDisplayNames(Calendar.DAY_OF_WEEK, Calendar.LONG, locale);
    NavigableMap<String, Integer> nav = new TreeMap<String, Integer>(names);
    System.out.printf("Whole list:%n%s%n", nav);
    System.out.printf("Key ceiling after Sunday: %s%n", nav.ceilingKey("Sunday"));
  Java Book 

  1. NavigableMap
  2. NavigableMap: ceilingKey(T key)
  3. NavigableMap: floorKey(T key)
  4. NavigableMap: higherKey(String key)
  5. NavigableMap: lastEntry()
  6. NavigableMap: lowerKey(T key)
  7. NavigableMap: navigableKeySet()
  8. NavigableMap: pollFirstEntry()
  9. NavigableMap: pollLastEntry()