MavenEnvironment extends Environment<Class<?>> { @Override public void error(String message) { errors.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 error() { environment.error("error"); assertEquals(new SimpleEntry<>(null, "error"), environment.errors.get(0)); assertTrue(environment.warnings.isEmpty()); }
@Test void error_location() { environment.error(Object.class, "error"); assertEquals(new SimpleEntry<>(Object.class, "error"), environment.errors.get(0)); assertTrue(environment.warnings.isEmpty()); }