private Path<?> getPath(Expression<?> leftHandSide) {
        if (leftHandSide instanceof Path<?>) {
            return (Path<?>) leftHandSide;
        } else if (leftHandSide instanceof Operation<?>) {
            Operation<?> operation = (Operation<?>) leftHandSide;
            if (operation.getOperator() == Ops.LOWER
                    || operation.getOperator() == Ops.UPPER) {
                return (Path<?>) operation.getArg(0);
            }
        }
        throw new IllegalArgumentException("Unable to transform "
                + leftHandSide + " to path");
    }
If the query is a BooleanQuery and it contains a single Occur.MUST_NOT
clause it will be returned as is. Otherwise it will be wrapped in a
BooleanClause with the given Occur.
querydsl-lucene5/src/main/java/com/querydsl/lucene5/LuceneSerializer.java