@Override
    public T newInstance(Object... args) {
        if (args[0] != null) {
            if (getType().equals(Boolean.class)) {
                return (T) Boolean.valueOf(((Number) args[0]).intValue() > 0);
            } else {
                return (T) MathUtils.cast((Number) args[0], (Class) getType());
            }
        } else {
            return null;
        }
    }
{@code NumberConversion} ensures that the results of a numeric projection conform to the type of the
projection expression

@author tiwe

@param <T>
querydsl-core/src/main/java/com/querydsl/core/support/NumberConversion.java