@Override
    protected void visitOperation(Class<?> type, Operator operator, List<? extends Expression<?>> args) {
        if (Ops.aggOps.contains(operator)) {
            throw new UnsupportedOperationException("Aggregation operators are only supported as single expressions");
        }
        if (args.size() == 2 && OPERATOR_SYMBOLS.containsKey(operator)
             && isPrimitiveOrWrapperType(args.get(0).getType()) && isPrimitiveOrWrapperType(args.get(1).getType())) {
            handle(args.get(0));
            append(OPERATOR_SYMBOLS.get(operator));
            handle(args.get(1));
            if (args.get(1) instanceof Constant<?>) {
                append(CAST_SUFFIXES.get(args.get(1).getType()));
            }
            return;
        }

        if (operator == Ops.STRING_CAST) {
            visitCast(operator, args.get(0), String.class);
        } else if (operator == Ops.NUMCAST) {
            @SuppressWarnings("unchecked") //this is the second argument's type
            Constant<Class<?>> rightArg = (Constant<Class<?>>) args.get(1);

            visitCast(operator, args.get(0), rightArg.getConstant());
        } else {
            super.visitOperation(type, operator, args);
        }
    }
{@code CollQuerySerializer} is a {@link Serializer} implementation for the Java language

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