@SuppressWarnings("unchecked")
    @Nullable
    private static <D, P extends Path<D>> P getPath(D arg) {
        final Object current = aliasFactory.getCurrentAndReset();
        if (arg instanceof Path<?>) {
            return (P) arg;
        } else if (arg instanceof ManagedObject) {
            return (P) ((ManagedObject) arg).__mappedPath();
        } else {
            return (P) current;
        }
    }
Convert the given alias to an expression

@param arg alias
@param <D>
@return expression
querydsl-core/src/main/java/com/querydsl/core/alias/Alias.java