### Question:
EnvironmentUtils { public static Map<String, Object> extractProperties(ConfigurableEnvironment environment) { return Collections.unmodifiableMap(doExtraProperties(environment)); }  static Map<String, Object> extractProperties(ConfigurableEnvironment environment);  }### Answer:
@Test public void testExtraProperties() { System.setProperty("user.name", "mercyblitz"); StandardEnvironment environment = new StandardEnvironment(); Map<String, Object> map = new HashMap<>(); map.put("user.name", "Mercy"); MapPropertySource propertySource = new MapPropertySource("first", map); CompositePropertySource compositePropertySource = new CompositePropertySource("comp"); compositePropertySource.addFirstPropertySource(propertySource); MutablePropertySources propertySources = environment.getPropertySources(); propertySources.addFirst(compositePropertySource); Map<String, Object> properties = EnvironmentUtils.extractProperties(environment); Assert.assertEquals("Mercy", properties.get("user.name")); }