@SuppressWarnings("unchecked")
    public static <T extends Number & Comparable<?>> NumberExpression<T> create(T val) {
        return new NumberConstant<T>((Class<T>) val.getClass(), val);
    }
Factory method

@param <T>
@param val
@return
querydsl-core/src/test/java/com/querydsl/core/NumberConstant.java