public static <T> T[] notEmpty(T[] array, Supplier<String> messageProvider) {
    checkArgument(array != null && array.length > 0, messageProvider);
    return array;
  }
Assert that the supplied array is neither {@code null} nor <em>empty</em>.
<p>
This method does NOT check if the supplied
array contains any {@code null} elements.

@param array           the array to check
@param messageProvider violation message
@return the supplied array as a convenience
@throws IllegalArgumentException if the supplied array is {@code null} or contains no elements.
@see #containsNoNullElements(Object[], Supplier)
spock-core/src/main/java/org/spockframework/util/Checks.java