protected Query stringRange(
            Path<?> leftHandSide,
            String field,
            @Nullable Expression<?> min,
            @Nullable Expression<?> max,
            boolean minInc,
            boolean maxInc,
            QueryMetadata metadata) {

        if (min == null) {
            return new TermRangeQuery(
                    field, null, convert(leftHandSide, max, metadata)[0], minInc, maxInc);
        } else if (max == null) {
            return new TermRangeQuery(
                    field, convert(leftHandSide, min, metadata)[0],
                    null, minInc, maxInc);
        } else {
            return new TermRangeQuery(
                    field, convert(leftHandSide, min, metadata)[0],
                    convert(leftHandSide, max, metadata)[0],
                    minInc, maxInc);
        }
    }
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-lucene3/src/main/java/com/querydsl/lucene3/LuceneSerializer.java