class MpConfig {

    public static io.helidon.config.Config toHelidonConfig(Config mpConfig) {
        if (mpConfig instanceof io.helidon.config.Config) {
            return (io.helidon.config.Config) mpConfig;
        }

        // If the mpConfig is based on an SE config (such as when we use meta configuration)
        // we must reuse that se config instance
        Iterator<ConfigSource> configSources = mpConfig.getConfigSources().iterator();
        ConfigSource first = configSources.hasNext() ? configSources.next() : null;
        if (!configSources.hasNext() && first instanceof MpHelidonConfigSource) {
            // we only have Helidon SE config as a source - let's just use it
            return ((MpHelidonConfigSource) first).unwrap();
        }

        // we use Helidon SE config to handle object mapping (and possible other mappers on classpath)
        io.helidon.config.Config mapper = io.helidon.config.Config.builder()
                .sources(ConfigSources.empty())
                .overrides(OverrideSources.empty())
                .disableEnvironmentVariablesSource()
                .disableSystemPropertiesSource()
                .disableParserServices()
                .disableFilterServices()
                .disableCaching()
                .disableValueResolving()
                .changesExecutor(command -> {
                })
                .build();

        return new SeConfig(mapper, mpConfig);
    }

    private  MpConfig();

}