Finds the maximum element in the given array. @param the type of elements in the array, which must implement the Comparable interface @param array the array to be searched @return the maximum element in the array @throws IllegalArgumentException if the array is null or empty
(final T[] array)
| 107 | * @throws IllegalArgumentException if the array is null or empty |
| 108 | */ |
| 109 | private static <T extends Comparable<T>> T max(final T[] array) { |
| 110 | return Arrays.stream(array).max(Comparable::compareTo).orElseThrow(); |
| 111 | } |
| 112 | } |
no test coverage detected