private Optional<ChangesRequiringRestart> compareConfigFromCurrentAndNextModel(Service service,
                                                                                   Class<? extends ConfigInstance> configClass,
                                                                                   AbstractConfigProducerRoot currentModel,
                                                                                   AbstractConfigProducerRoot nextModel,
                                                                                   DeployLogger logger) {

        if (!hasConfigFieldsFlaggedWithRestart(configClass, service.getClass())) {
            logger.logApplicationPackage(Level.FINE, String.format("%s is listed in the annotation for %s, " +
                            "but does not have any restart flags in its config definition.",
                    configClass.getSimpleName(), service.getClass().getSimpleName()));
            return Optional.empty();
        }

        Optional<ConfigInstance> nextConfig = getConfigFromModel(nextModel, configClass, service.getConfigId());
        if (!nextConfig.isPresent()) {
            logger.logApplicationPackage(Level.FINE, String.format(
                    "%s is listed as restart config for %s, but the config does not exist in the new model.",
                    configClass.getSimpleName(), service.getClass().getSimpleName()));
            return Optional.empty();
        }

        Optional<ConfigInstance> currentConfig = getConfigFromModel(currentModel, configClass, service.getConfigId());
        if (!currentConfig.isPresent()) {
            return Optional.empty();
        }
        return Optional.of(ReflectionUtil.getChangesRequiringRestart(currentConfig.get(), nextConfig.get()));
    }
Returns the ConfigInstances classes from the annotation on the given Service class ,
including the ConfigInstances annotated on any of its super classes.
NOTE: Only the super classes that are subclass of Service are inspected.
config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/ConfigValueChangeValidator.java