public static Map<String, Object> extractProperties(ConfigurableEnvironment environment) {
        return Collections.unmodifiableMap(doExtraProperties(environment));
    }
@Test
    void testExtraProperties() {

        String key = "test.name";
        System.setProperty(key, "Tom");

        try {
            StandardEnvironment environment = new StandardEnvironment();

            Map<String, Object> map = new HashMap<>();

            map.put(key, "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);

            Assertions.assertEquals("Mercy", properties.get(key));
        } finally {
            System.clearProperty(key);
        }
    }