private void visitCast(Operator operator, Expression<?> source, Class<?> targetType) {
        if (Number.class.isAssignableFrom(source.getType()) && !Constant.class.isInstance(source)) {
            append("new ").append(source.getType().getSimpleName()).append("(");
            handle(source);
            append(")");
        } else {
            handle(source);
        }

        if (CAST_SUFFIXES.containsKey(targetType)) {
            append(CAST_SUFFIXES.get(targetType));
        } else {
            throw new IllegalArgumentException("Unsupported cast type " + targetType.getName());
        }
    }
{@code CollQuerySerializer} is a {@link Serializer} implementation for the Java language

@author tiwe
querydsl-collections/src/main/java/com/querydsl/collections/CollQuerySerializer.java