public List<String> mergePartitions(
            MergingStrategy mergingStrategy,
            List<String> sourcePartitions,
            List<String> derivedPartitions) {

        if (!derivedPartitions.isEmpty()
                && !sourcePartitions.isEmpty()
                && mergingStrategy != MergingStrategy.EXCLUDING) {
            throw new ValidationException(
                    "The base table already has partitions defined. You might want to specify "
                            + "EXCLUDING PARTITIONS.");
        }

        if (!derivedPartitions.isEmpty()) {
            return derivedPartitions;
        }
        return sourcePartitions;
    }
@Test
    void mergePartitionsFromBaseTable() {
        List<String> sourcePartitions = Arrays.asList("col1", "col2");
        List<String> mergePartitions =
                util.mergePartitions(
                        getDefaultMergingStrategies().get(FeatureOption.PARTITIONS),
                        sourcePartitions,
                        Collections.emptyList());

        assertThat(mergePartitions).isEqualTo(sourcePartitions);
    }