ApexParser { public static Parser<Grammar> create(ApexConfiguration config) { if (config == null) { throw new IllegalArgumentException(ERROR_MESSAGE); } return Parser.builder(ApexGrammar.create()) .withLexer(ApexLexer.create(config)).build(); } private  ApexParser(); static Parser<Grammar> create(ApexConfiguration config);  }
@Test(expected = IllegalArgumentException.class) public void testThrowingAnExceptionWhenCreateParserWithNullConfiguration() { ApexParser.create(null); }