code: public static <T> List<String> getUniqeDocIdList(List<T> results, Ordering<T> ordering, Function<T, String> toIdString) {
      Collections.sort(results, ordering);
      Set<String> list = Sets.newLinkedHashSet();
      for (T result : results) {
        list.add(toIdString.apply(result));
      }
      return Lists.newArrayList(list);
    }
docs: return uniquePmidsByTopic