private Cases<Boolean, BooleanExpression> thenBoolean(Expression<Boolean> expr) {
            return new Cases<Boolean,BooleanExpression>(Boolean.class) {
                @Override
                protected BooleanExpression createResult(Class<? extends Boolean> type, Expression<Boolean> last) {
                    return Expressions.booleanOperation(Ops.CASE, last);
                }

            }.addCase(when, expr);
        }
Initial state of Case construction

@author tiwe
querydsl-core/src/main/java/com/querydsl/core/types/dsl/CaseBuilder.java