### Question:
CFEnvironment implements Environment { public static CFEnvironment getInstance() { return getInstance(System::getenv, System::getProperty); } private  CFEnvironment(); static CFEnvironment getInstance(); @Override OAuth2ServiceConfiguration getXsuaaConfiguration(); @Nullable @Override OAuth2ServiceConfiguration getIasConfiguration(); @Override int getNumberOfXsuaaConfigurations(); @Override OAuth2ServiceConfiguration getXsuaaConfigurationForTokenExchange(); @Override Type getType(); @Nullable OAuth2ServiceConfiguration loadForServicePlan(Service service, Plan plan);  }### Answer:
@Test public void getInstance() { assertThat(CFEnvironment.getInstance()).isNotSameAs(CFEnvironment.getInstance()); assertThat(cut.getType()).isEqualTo(Environment.Type.CF); }
@Test public void getCorruptConfiguration_raisesException() { String xsuaaBinding = "{\"xsuaa\": [{ \"credentials\": null }]}"; assertThatThrownBy(() -> { cut = CFEnvironment.getInstance((str) -> xsuaaBinding, (str) -> null); }).isInstanceOf(JsonParsingException.class).hasMessageContainingAll( "The credentials of 'VCAP_SERVICES' can not be parsed for service 'XSUAA'", "Please check the service binding."); }