MavenEnvironment extends Environment<Class<?>> { @Override public void warn(String message) { warnings.add(new SimpleEntry(null, message)); } MavenEnvironment(Project project); @Override void error(String message); @Override void error(Class<?> location, String message); @Override void warn(String message); @Override void warn(Class<?> location, String message);  }
@Test void warn() { environment.warn("warning"); assertEquals(new SimpleEntry<>(null, "warning"), environment.warnings.get(0)); assertTrue(environment.errors.isEmpty()); }
@Test void warn_location() { environment.warn(Object.class, "warning"); assertEquals(new SimpleEntry<>(Object.class, "warning"), environment.warnings.get(0)); assertTrue(environment.errors.isEmpty()); }