(final Iterable<T> source, final Function<T, Integer> valueAccessor)
| 37 | } |
| 38 | |
| 39 | public static final <T> Integer min(final Iterable<T> source, final Function<T, Integer> valueAccessor) { |
| 40 | if (source == null) { return null; } |
| 41 | int max = Integer.MAX_VALUE; |
| 42 | for (final T c : source) { |
| 43 | int value = valueAccessor.apply(c); |
| 44 | if (value < max) { |
| 45 | max = value; |
| 46 | } |
| 47 | } |
| 48 | return max; |
| 49 | } |
| 50 | |
| 51 | public static Integer min(final Iterable<Integer> source) { |
| 52 | if (source == null) return null; |
no test coverage detected