private void checkStringIsValidName ( final String s ) throws PackageNameException { final boolean packageContainsJavaKeyword = javaKeywords . stream ( ) . anyMatch ( s :: equals ) ; if ( packageContainsJavaKeyword || s . matches ( "\\d.*" ) ) { throw new PackageNameException ( "string is not valid" ) ; } }
Checks that string is not java keyword and is qualified java name