PermissionParser extends Parser<T> { protected void checkMalformed(T type, Permission permission) { String name = permission.value(); if (!matcher.reset(name).matches()) { environment.warn(type, format(name, "may be malformed")); } for (var child : permission.children()) { if (!matcher.reset(child).matches()) { environment.warn(type, format(child, "may be malformed")); } } } PermissionParser(Environment<T> environment); @Override void clear();  }
@Test void checkMalformed_warn() { parser.checkMalformed(Malformed.class, Malformed.class.getAnnotation(Permission.class)); verify(environment, times(2)).warn(Malformed.class, "\"a b\" may be malformed"); verify(environment).warn(Malformed.class, "\"ce!\" may be malformed"); }