@Nullable
    public EntityType getEntityType(TypeMirror typeMirror, boolean deep) {
        List<String> key = keyBuilder.visit(typeMirror, true);
        // get from cache
        if (entityTypeCache.containsKey(key)) {
            EntityType entityType = entityTypeCache.get(key);
            if (deep && entityType.getSuperTypes().isEmpty()) {
                for (Type superType : getSupertypes(typeMirror, deep)) {
                    entityType.addSupertype(new Supertype(superType));
                }
            }
            return entityType;

        // create
        } else {
            return createEntityType(typeMirror, key, deep);

        }
    }
{@code ExtendedTypeFactory} is a factory for APT-based inspection {@link Type} creation

@author tiwe
querydsl-apt/src/main/java/com/querydsl/apt/ExtendedTypeFactory.java