private <T extends Comparable> Cases<T, DateTimeExpression<T>> thenDateTime(Expression<T> expr) {
            return new Cases<T, DateTimeExpression<T>>(expr.getType()) {
                @Override
                protected DateTimeExpression<T> createResult(Class<? extends T> type, Expression<T> last) {
                    return Expressions.dateTimeOperation(type, 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