@Override
    public MODEL createModel(ConfigModelContext context) {
        try {
            Type [] params = constructor.getGenericParameterTypes();
            if (params.length < 1 || ! params[0].equals(ConfigModelContext.class)) {
                throw new IllegalArgumentException("Constructor for " + clazz.getName() + " must have as its first argument a " + ConfigModelContext.class.getName());
            }
            Object[] arguments = new Object[params.length];
            arguments[0] = context;
            for (int i = 1; i < params.length; i++)
                arguments[i] = findArgument(params[i]);
            MODEL instance = constructor.newInstance(arguments);
            instances.add(instance);
            return instance;
        } catch (InvocationTargetException | InstantiationException | IllegalAccessException e) {
            throw new RuntimeException("Error constructing model '" + clazz.getName() + "'", e);
        }
    }
This adds dependencies base on constructor arguments in the model classes themselves.
These then have to be created by this mini-di framework and then handed to the builders
that will fill them.

TODO: This should be changed to model dependencies between model builders instead, such
that they can create their model objects, and eventually make them immutable.
config-model/src/main/java/com/yahoo/config/model/graph/ModelNode.java