private void checkAndAddRequiredSubStrings ( final List < String > requiredSubStrings ) { for ( String required : requiredSubStrings ) { if ( required == null ) { throw new NullPointerException ( "required substring should not be null" ) ; } this . requiredSubStrings . add ( required ) ; } }
Adds each required substring checking that it s not null .