### Question:
EnvironmentFieldRetriever extends FieldRetriever { @Override public String getField(String field) { return getEnvironmentVariableValue(field, null); } EnvironmentFieldRetriever(); @Override String getField(String field); @Override String getField(String field, String defaultValue); @Override boolean isFieldSet(String field); void setEnvironmentVariableProvider(EnvironmentVariableProvider environmentVariableProvider);  }### Answer:
@Test void testVariableFound() { doReturn(FIELD_VALUE).when(mockEnvironmentVariableProvider).getVariable(PAYLOAD); Assert.assertEquals(fieldRetriever.getField(PAYLOAD), FIELD_VALUE); }
@Test void testVariableFoundWithDefault() { doReturn(FIELD_VALUE).when(mockEnvironmentVariableProvider).getVariable(PAYLOAD); Assert.assertEquals(fieldRetriever.getField(PAYLOAD, DEFAULT_VALUE), FIELD_VALUE); }
@Test public void testMissingVariableDefault() { Assert.assertEquals(fieldRetriever.getField(PAYLOAD, DEFAULT_VALUE), DEFAULT_VALUE); }
@Test public void testMissingVariable() { Assert.assertNull(fieldRetriever.getField(PAYLOAD)); }