1.mvnrepository上搜索 guava。并引用其jar包
类似compile "com.google.guava:guava:18.0"
测试代码
Builder<String, String> b2 = ImmutableSortedMap.naturalOrder(); b2.put("sta_1111", "sta_1111");
b2.put("sta_2222", "sta_2222"); b2.put("sys_1123", "sys_1123"); b2.put("sta_1122", "sta_1122"); b2.put("sys_1122", "sys_1122");
ImmutableSortedMap<String, String> map = b2.build(); for(Entry<String, String> entry : map.entrySet()) { System.out.println(entry.getKey()); }