(List<T> items, Predicate<T> critereon)
| 2558 | } |
| 2559 | |
| 2560 | private static <T> List<T> select(List<T> items, Predicate<T> critereon) { |
| 2561 | ArrayList<T> result = new ArrayList<>(); |
| 2562 | for (int i = 0; i != items.size(); ++i) { |
| 2563 | T ith = items.get(i); |
| 2564 | if (critereon.test(ith)) { |
| 2565 | result.add(ith); |
| 2566 | } |
| 2567 | } |
| 2568 | return result; |
| 2569 | } |
| 2570 | |
| 2571 | /** |
| 2572 | * Determine whether a cast from one type to another is "sensible". That is, |
no test coverage detected