List of usage examples for com.google.common.collect Maps newTreeMap
public static <K extends Comparable, V> TreeMap<K, V> newTreeMap()
From source file:com.google.gerrit.server.group.ListGroups.java
@Override public Object apply(TopLevelResource resource) throws AuthException, BadRequestException, ResourceConflictException, Exception { final Map<String, GroupInfo> output = Maps.newTreeMap(); for (GroupInfo info : get()) { output.put(Objects.firstNonNull(info.name, "Group " + Url.decode(info.id)), info); info.name = null;// w ww. j av a2s . c o m } return OutputFormat.JSON.newGson().toJsonTree(output, new TypeToken<Map<String, GroupInfo>>() { }.getType()); }