@SuppressWarnings("unchecked")
    public final <T> T get(Class<T> iface) {
        if (instances.containsKey(iface)) {
            return (T) instances.get(iface);
        } else if (bindings.containsKey(iface)) {
            Class<?> implementation = bindings.get(iface);
            T instance = (T) createInstance(implementation);
            instances.put(iface, instance);
            return instance;
        } else {
            throw new IllegalArgumentException(iface.getName() + " is not registered");
        }
    }
{@code AbstractModule} provides a base class for annotation based dependency injection

@author tiwe
querydsl-codegen/src/main/java/com/querydsl/codegen/AbstractModule.java