private void initForClass(Map<Class<?>, S> context, S system, Class<? extends Object> systemClass) {
        for (Field field : systemClass.getDeclaredFields()) {
            final Inject inject = field.getAnnotation(Inject.class);
            if (inject != null) {
                final Object value = context.get(field.getType());
                if (value != null) {
                    field.setAccessible(true);
                    try {
                        field.set(system, value);
                    } catch (IllegalAccessException e) {
                        throw new RuntimeException(e);
                    }
                } else {
                    if (!inject.optional())
                        throw new RuntimeException("Unknown objects of type " + field.getType().getName() + " requested in " + systemClass.getName() + ", but none found in context");
                }
            }
        }
    }