public Map<String, String> mergeOptions(
            MergingStrategy mergingStrategy,
            Map<String, String> sourceOptions,
            Map<String, String> derivedOptions) {
        Map<String, String> options = new HashMap<>();
        if (mergingStrategy != MergingStrategy.EXCLUDING) {
            options.putAll(sourceOptions);
        }

        derivedOptions.forEach(
                (key, value) -> {
                    if (mergingStrategy != MergingStrategy.OVERWRITING
                            && options.containsKey(key)) {
                        throw new ValidationException(
                                String.format(
                                        "There already exists an option ['%s' -> '%s']  in the "
                                                + "base table. You might want to specify EXCLUDING OPTIONS or OVERWRITING OPTIONS.",
                                        key, options.get(key)));
                    }

                    options.put(key, value);
                });
        return options;
    }
@Test
    void mergeOverwritingOptionsDuplicate() {
        Map<String, String> sourceOptions = new HashMap<>();
        sourceOptions.put("offset", "1");
        sourceOptions.put("format", "json");

        Map<String, String> derivedOptions = new HashMap<>();
        derivedOptions.put("offset", "2");
        derivedOptions.put("format.ignore-errors", "true");

        Map<String, String> mergedOptions =
                util.mergeOptions(MergingStrategy.OVERWRITING, sourceOptions, derivedOptions);

        Map<String, String> expectedOptions = new HashMap<>();
        expectedOptions.put("offset", "2");
        expectedOptions.put("format", "json");
        expectedOptions.put("format.ignore-errors", "true");

        assertThat(mergedOptions).isEqualTo(expectedOptions);
    }