code: public static void checkArrayForNullElement(Object[] array,
              String arrayName) {
          for (Object elt : array) {
              if (elt == null) {
                  throw new IllegalArgumentException(arrayName
                          + " cannot contain null values");
              }
          }
      }
docs: Checks if the specified array has any null elements. If so, an
  [@link IllegalArgumentException is thrown.
  
  @param array an {@link Object[]}. Must not be <code>null</code>, or
  a {@link NullPointerException} will be thrown.
  @param arrayName the variable name {@link String} of the array (used
  in the exception message). Should not be <code>null</code>, or the
  exception message will not indicate which parameter was erroneously
  <code>null</code>.