public static void hasLength ( String input , int length , String message ) { notNull ( input , message ) ; if ( input . trim ( ) . length ( ) != length ) { throw new IllegalArgumentException ( message ) ; } }
Asserts that a String is not null and of a certain length