class BootstrapTools {

	public static String getDynamicPropertiesAsString(Configuration baseConfig, Configuration targetConfig) {

		String[] newAddedConfigs = targetConfig.keySet().stream().flatMap(
			(String key) -> {
				final String baseValue = baseConfig.getString(ConfigOptions.key(key).stringType().noDefaultValue());
				final String targetValue = targetConfig.getString(ConfigOptions.key(key).stringType().noDefaultValue());

				if (!baseConfig.keySet().contains(key) || !baseValue.equals(targetValue)) {
					return Stream.of("-" + CommandLineOptions.DYNAMIC_PROPERTY_OPTION.getOpt() + key +
						CommandLineOptions.DYNAMIC_PROPERTY_OPTION.getValueSeparator() + escapeForDifferentOS(targetValue));
				} else {
					return Stream.empty();
				}
			})
			.toArray(String[]::new);
		return String.join(" ", newAddedConfigs);
	}

	private  BootstrapTools();

}