Returns the least value present in array. @param array a nonempty array of byte values @return the value present in array that is less than or equal to every other value in the array @throws IllegalArgumentException if array is empty
(byte... array)
| 142 | |
| 143 | |
| 144 | public static byte min(byte... array) { |
| 145 | checkArgument(array.length > 0); |
| 146 | int min = toInt(array[0]); |
| 147 | for (int i = 1; i < array.length; i++) { |
| 148 | int next = toInt(array[i]); |
| 149 | if (next < min) { |
| 150 | min = next; |
| 151 | } |
| 152 | } |
| 153 | return (byte) min; |
| 154 | } |
| 155 | |
| 156 | /** |
| 157 | * Returns the greatest value present in {@code array}. |
no test coverage detected