protected Query in(Operation<?> operation, QueryMetadata metadata,
            boolean ignoreCase) {
        Path<?> path = getPath(operation.getArg(0));
        String field = toField(path);
        @SuppressWarnings("unchecked")
        // this is the expected type
        Constant<Collection<?>> expectedConstant = (Constant<Collection<?>>) operation
                .getArg(1);
        Collection<?> values = expectedConstant.getConstant();
        BooleanQuery bq = new BooleanQuery();
        if (Number.class.isAssignableFrom(path.getType())) {
            for (Object value : values) {
                TermQuery eq = new TermQuery(new Term(field, convertNumber((Number) value)));
                bq.add(eq, Occur.SHOULD);
            }
        } else {
            for (Object value : values) {
                String[] str = convert(path, value);
                bq.add(eq(field, str, ignoreCase), Occur.SHOULD);
            }
        }
        return bq;
    }
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