public static < T extends Collection < ? > > T requireNonNullNorEmpty ( T collection , String message ) { if ( requireNonNull ( collection ) . isEmpty ( ) ) { throw new IllegalArgumentException ( message ) ; } return collection ; }
Require a collection to be neither null nor empty .