public List<String> testSorted(List<String> list) {
   List<String> result = new ArrayList<>();
   for (String s : list) {
     result.add(s);
   }
   result.sort(null);
   return result.toArray(new String[0]);
 }
Example #2
0
 public List<Answer> classicFind(Predicate<Answer> pred) {
   List<Answer> results = new ArrayList<Answer>();
   for (Answer answer : answers.values()) if (pred.test(answer)) results.add(answer);
   return results;
 }