@SuppressWarnings("unchecked")
        public Q otherwise(Expression<T> otherwise) {
            caseElements.add(0, new CaseElement<D>(null, otherwise));
            Expression<T> last = null;
            for (CaseElement<D> element : caseElements) {
                if (last == null) {
                    last = Expressions.operation((Class<T>) type, Ops.CASE_EQ_ELSE,
                            element.getTarget());
                } else {
                    last = Expressions.operation((Class<T>) type, Ops.CASE_EQ_WHEN,
                            base,
                            element.getEq(),
                            element.getTarget(),
                            last);
                }
            }
            return createResult((Class<T>) type, last);
        }
Intermediate step

@param <T> Result type
@param <Q> Parent expression type
querydsl-core/src/main/java/com/querydsl/core/types/dsl/CaseForEqBuilder.java