@SuppressWarnings("unchecked")
    private static Class<? extends ConfigInstance> getConfigClass(Class<? extends ConfigInstance.Builder> builderClass) {
        Class<?> configClass = builderClass.getEnclosingClass();
        if (configClass == null || ! ConfigInstance.class.isAssignableFrom(configClass)) {
            throw new ConfigurationRuntimeException("Builder class " + builderClass + " has enclosing class " +
                                                    configClass + ", which is not a ConfigInstance");
        }
        return (Class<? extends ConfigInstance>) configClass;
    }
If some fields on the builder are null now, set them from the def. Do recursively.
<p>
If the targetDef has some schema incompatibilities, they are not handled here
(except logging in some cases), but in ConfigInstance.serialize().

@param  builder a {@link com.yahoo.config.ConfigBuilder}
@param  targetDef a config definition
@throws Exception if applying values form config definitions fails
configserver/src/main/java/com/yahoo/vespa/config/server/application/ConfigInstanceBuilder.java