Java tutorial
import java.util.TreeMap; public class Main { public static void main(String[] args) { TreeMap<Integer, String> db = new TreeMap<Integer, String>(); db.put(1000, "1000"); db.put(1011, "1011"); db.put(1102, "1102"); db.put(2023, "2023"); db.put(2034, "2034"); System.out.println("First key lower than 2034: " + db.lowerKey(2034)); } }