Validates that the input iterable is not empty. @param numbers the input numbers to validate @throws IllegalArgumentException if the input is empty
(final Iterable<Double> numbers)
| 136 | * @throws IllegalArgumentException if the input is empty |
| 137 | */ |
| 138 | private static void checkIfNotEmpty(final Iterable<Double> numbers) { |
| 139 | if (!numbers.iterator().hasNext()) { |
| 140 | throw new IllegalArgumentException("Empty list given for Mean computation."); |
| 141 | } |
| 142 | } |
| 143 | } |