@Override
    public Set<Expression<?>> visit(TemplateExpression<?> expr, Set<Expression<?>> known) {
        for (Object arg : expr.getArgs()) {
            if (arg instanceof Expression<?>) {
                known = ((Expression<?>) arg).accept(this, known);
            }
        }
        return known;
    }
{@code ValidatingVisitor} visits expressions and ensures that only known path instances are used

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