private static void checkForNullElement(Object[] arg,String argName){
  if ((arg == null) || (arg.length == 0)) {
    throw new IllegalArgumentException("Argument " + argName + "[] cannot be null or empty.");
  }
  for (int i=0; i < arg.length; i++) {
    if (arg[i] == null) {
      throw new IllegalArgumentException("Argument's element " + argName + "["+ i+ "] cannot be null.");
    }
  }
}

private static void checkForNullElement ( Object [ ] arg , String argName ) { if ( ( arg == null ) || ( arg . length == 0 ) ) { throw new IllegalArgumentException ( "Argument " + argName + "[] cannot be null or empty." ) ; } for ( int i = 0 ; i < arg . length ; i ++ ) { if ( arg [ i ] == null ) { throw new IllegalArgumentException ( "Argument's element " + argName + "[" + i + "] cannot be null." ) ; } } }
checks that object [ ] arg is neither null nor empty ( ie length = = 0 ) and that it does not contain any null element .
