### Question:
PmdTemplate { public static PmdTemplate create(String javaVersion, ClassLoader classloader, Charset charset) { PMDConfiguration configuration = new PMDConfiguration(); configuration.setDefaultLanguageVersion(languageVersion(javaVersion)); configuration.setClassLoader(classloader); configuration.setSourceEncoding(charset.name()); SourceCodeProcessor processor = new SourceCodeProcessor(configuration); return new PmdTemplate(configuration, processor); } PmdTemplate(PMDConfiguration configuration, SourceCodeProcessor processor); static PmdTemplate create(String javaVersion, ClassLoader classloader, Charset charset); void process(InputFile file, RuleSets rulesets, RuleContext ruleContext);  }### Answer:
@Test void should_fail_on_invalid_java_version() { final Throwable thrown = catchThrowable(() -> PmdTemplate.create("12.2", mock(ClassLoader.class), StandardCharsets.UTF_8)); assertThat(thrown).isInstanceOf(IllegalArgumentException.class); }
@Test void shouldnt_fail_on_valid_java_version() { PmdTemplate.create("6", mock(ClassLoader.class), StandardCharsets.UTF_8); }