@SuppressWarnings("unchecked")
        public <A> Cases<A, SimpleExpression<A>> then(Expression<A> expr) {
            if (expr instanceof Predicate) {
                return (Cases) then((Predicate) expr);
            } else if (expr instanceof StringExpression) {
                return (Cases) then((StringExpression) expr);
            } else if (expr instanceof NumberExpression) {
                return then((NumberExpression) expr);
            } else if (expr instanceof DateExpression) {
                return then((DateExpression) expr);
            } else if (expr instanceof DateTimeExpression) {
                return then((DateTimeExpression) expr);
            } else if (expr instanceof TimeExpression) {
                return then((TimeExpression) expr);
            } else if (expr instanceof ComparableExpression) {
                return then((ComparableExpression) expr);
            } else {
                return thenSimple(expr);
            }
        }
Initial state of Case construction

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