class PropertySourceUtils {

	private PropertySourceUtils() {
		throw new IllegalStateException("Can't instantiate a utility class");
	}

	/**
	 * Function to convert a String to Properties.
	 */
	public static final Function<String, Properties> KEY_VALUE_TO_PROPERTIES = s -> {
		Properties properties = new Properties();
		try {
			properties.load(new ByteArrayInputStream(s.getBytes()));
			return properties;
		}
		catch (IOException e) {
			throw new UncheckedIOException(e);
		}
	};

	/**
	 * Function to convert Properties to a Map.
	 */
	public static final Function<Properties, Map<String, Object>> PROPERTIES_TO_MAP = p -> p.entrySet().stream()
			.collect(Collectors.toMap(e -> e.getKey().toString(), Map.Entry::getValue));

	/**
	 * Function to convert String into Properties with an environment.
	 * @param environment Environment.
	 * @return properties.
	 */
	public static Function<String, Properties> yamlParserGenerator(Environment environment) {<FILL_FUNCTION_BODY>}

	/**
	 * returns a {@link BinaryOperator} that unconditionally throws an
	 * {@link IllegalStateException}.
	 * @param <T> type of the argument
	 * @return a {@link BinaryOperator}
	 */
	public static <T> BinaryOperator<T> throwingMerger() {
		return (left, right) -> {
			throw new IllegalStateException("Duplicate key " + left);
		};
	}

}

		return s -> {
			YamlPropertiesFactoryBean yamlFactory = new YamlPropertiesFactoryBean();
			yamlFactory.setDocumentMatchers(properties -> {
				if (environment != null) {
					String profiles = null;
					String activeOnProfile = properties.getProperty(SPRING_CONFIG_ACTIVATE_ON_PROFILE);
					String springProfiles = properties.getProperty(SPRING_PROFILES);

					if (activeOnProfile != null) {
						profiles = activeOnProfile;
					}
					else if (springProfiles != null) {
						profiles = springProfiles;
					}

					if (StringUtils.hasText(profiles)) {
						return environment.acceptsProfiles(Profiles.of(profiles)) ? FOUND : NOT_FOUND;
					}
				}
				return ABSTAIN;
			});
			yamlFactory.setResources(new ByteArrayResource(s.getBytes(StandardCharsets.UTF_8)));
			return yamlFactory.getObject();
		};
	
<no_super_class>