public static String checkNotEmpty(String arg, @Nullable Object errorMessage) {
    boolean empty = Strings.isNullOrEmpty(arg) || CharMatcher.whitespace().matchesAllOf(arg);
    checkArgument(!empty, errorMessage);
    return arg;
  }
public static String checkNotEmpty ( String arg , @ Nullable Object errorMessage ) { boolean empty = Strings . isNullOrEmpty ( arg ) || CharMatcher . whitespace ( ) . matchesAllOf ( arg ) ; checkArgument ( ! empty , errorMessage ) ; return arg ; }
Ensures the argument is not null, empty string, or just whitespace.

@param arg The argument
@param errorMessage The exception message to use if the check fails
@return The passed in argument if it is not blank