@Override
    public <N extends Number & Comparable<?>> NumberExpression<D> subtract(Expression<N> right) {
        if (right instanceof Constant<?>) {
            return subtract(((Constant<N>) right).getConstant());
        } else {
            return super.subtract(right);
        }
    }
Factory method

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