public static void notEmpty ( String parameter , String name ) throws IllegalArgumentException { if ( parameter != null && parameter . isEmpty ( ) ) { throw new IllegalArgumentException ( name + " is empty." ) ; } }
Test if string parameter is strict not empty . If parameter to test is null this test method does not rise exception .