private static Stream<Class<? extends ConfigInstance>> getConfigInstancesFromServiceAnnotations(Class<? extends Service> serviceClass) {
        List<Class<?>> classHierarchy = ReflectionUtil.getAllSuperclasses(serviceClass);
        classHierarchy.add(serviceClass);
        return classHierarchy.stream()
                .filter(Service.class::isAssignableFrom)
                .filter(clazz -> clazz.isAnnotationPresent(RestartConfigs.class))
                .map(clazz -> {
                    RestartConfigs annotation = clazz.getDeclaredAnnotation(RestartConfigs.class);
                    if (annotation.value().length == 0) {
                        throw new IllegalStateException(String.format(
                                "%s has a %s annotation with no ConfigInstances given as argument.",
                                clazz.getSimpleName(), RestartConfigs.class.getSimpleName()));
                    }
                    return annotation;
                })
                .map(RestartConfigs::value)
                .flatMap(Arrays::stream)
                .distinct();
    }
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