Пример #1
0
 public List<Answer> find(Predicate<Answer> pred) {
   return answers.values().stream().filter(pred).collect(Collectors.toList());
 }
Пример #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;
 }