LoadParser extends SingleParser<T> { protected void check(T type, String[] names) { for (var name : names) { if (!matcher.reset(name).matches()) { environment.error(type, format(name, "is not a valid plugin name, should contain only alphanumeric characters and \"_\"")); } } } LoadParser(Environment<T> environment);   }
@Test void check_errors() { parser.check(LoadParserTest.class, new String[] {"a1", "hey!", "sp ace"}); verify(environment).error(LoadParserTest.class, "\"hey!\" is not a valid plugin name, should contain only alphanumeric characters and \"_\""); verify(environment).error(LoadParserTest.class, "\"sp ace\" is not a valid plugin name, should contain only alphanumeric characters and \"_\""); }