public Map<String, String[]> getGroups() { LinkedHashMap<String, List<String>> m = new LinkedHashMap<String, List<String>>(); for (ApiDoc apiDoc : docs) { List<String> l = m.get(apiDoc.group); if (l == null) { l = new ArrayList<String>(); m.put(apiDoc.group, l); } Collections.addAll(l, apiDoc.routes); } return CollectionsHelper.listMapToArrayMap(m, String.class); }
@Override public long[] getFollowers(Context ctx, PeopleId friendId, Page page) { ParamChecker.notNull("ctx", ctx); ParamChecker.notNull("friendId", friendId); ArrayList<Long> l = new ArrayList<Long>(); for (Map.Entry<Long, FriendEntries> e : friends.entrySet()) { long userId = e.getKey(); FriendEntries fes = e.getValue(); if (fes.isFollowerOf(friendId)) l.add(userId); } if (page != null) page.retains(l); return CollectionsHelper.toLongArray(l); }
@Override protected AbstractHttpClient createClient() { return new TestHttpClient(client, host, CollectionsHelper.of("User-Agent", userAgent)); }