### Question:
EnvironmentConfigurator implements Consumer<BaseProject<?>> { public static EnvironmentConfigurator of(String name, String value) { return of(Collections.singletonMap(name, value)); } EnvironmentConfigurator(Map<String, String> edit); static EnvironmentConfigurator nothing(); static EnvironmentConfigurator system(); static EnvironmentConfigurator of(String name, String value); static EnvironmentConfigurator of(String name, Path path); static EnvironmentConfigurator of(Map<String, String> variables); @Override void accept(BaseProject<?> project);  }### Answer:
@Test public void of_pair() { BasicProject project = project() .with(EnvironmentConfigurator.of("TESTING", "OK")); assertThat(project.environment("TESTING"), is("OK")); project.with(EnvironmentConfigurator.of("TESTING", (String) null)); assertThat(project.environment("TESTING"), is(nullValue())); }
@Test public void of_path() throws IOException { Path path = Paths.get("src/main/java"); BasicProject project = project() .with(EnvironmentConfigurator.of("TESTING", path)); assertThat( Files.isSameFile(path, Paths.get(project.environment("TESTING"))), is(true)); }
@Test public void of_map() throws IOException { Map<String, String> vars = new LinkedHashMap<>(); vars.put("A", "1"); vars.put("B", "2"); vars.put("C", "3"); BasicProject project = project() .with(EnvironmentConfigurator.of(vars)); assertThat(project.environment("A"), is("1")); assertThat(project.environment("B"), is("2")); assertThat(project.environment("C"), is("3")); assertThat(project.environment("D"), is(nullValue())); Map<String, String> patch = new LinkedHashMap<>(); patch.put("B", "4"); patch.put("C", null); patch.put("D", "5"); project.with(EnvironmentConfigurator.of(patch)); assertThat(project.environment("A"), is("1")); assertThat(project.environment("B"), is("4")); assertThat(project.environment("C"), is(nullValue())); assertThat(project.environment("D"), is("5")); }