class JpaUnitObjectFactory implements ObjectFactory {

    @Override
    public <T> T getInstance(final Class<T> clazz) {
        if (!definitions.containsKey(clazz)) {
            definitions.put(clazz, createProxy(clazz));
        }
        return clazz.cast(definitions.get(clazz));
    }

}