public static void noNullElements(Object[] array) {
        Validate.notNull(array);
        for (int i = 0; i < array.length; i++) {
            if (array[i] == null) {
                throw new IllegalArgumentException("The validated array contains null element at index: " + i);
            }
        }
    }
public static void noNullElements ( Object [ ] array ) { Validate . notNull ( array ) ; for ( int i = 0 ; i < array . length ; i ++ ) { if ( array [ i ] == null ) { throw new IllegalArgumentException ( "The validated array contains null element at index: " + i ) ; } } }
<p>Validate that the specified argument array is neither
<code>null</code> nor contains any elements that are <code>null</code>;
otherwise throwing an exception.

<pre>Validate.noNullElements(myArray);</pre>

<p>If the array is <code>null</code>, then the message in the exception
is &quot;The validated object is null&quot;.</p>

<p>If the array has a <code>null</code> element, then the message in the
exception is &quot;The validated array contains null element at index:
&quot; followed by the index.</p>

@param array the array to check
@throws IllegalArgumentException if the array is <code>null</code> or
an element in the array is <code>null</code>