diff --git a/src/main/java/de/ids_mannheim/korap/Krill.java b/src/main/java/de/ids_mannheim/korap/Krill.java
index 437e1e9..5b40873 100644
--- a/src/main/java/de/ids_mannheim/korap/Krill.java
+++ b/src/main/java/de/ids_mannheim/korap/Krill.java
@@ -222,8 +222,8 @@
 
                 // TODO: Temporary
                 if (collNode.fieldNames().hasNext()) {
-                    this.setCollection(new KrillCollection()
-                            .fromKoral(collNode));
+                    this.setCollection(
+                            new KrillCollection().fromKoral(collNode));
                 };
             }
 
diff --git a/src/main/java/de/ids_mannheim/korap/KrillCollection.java b/src/main/java/de/ids_mannheim/korap/KrillCollection.java
index d49c4d6..38b0a48 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillCollection.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillCollection.java
@@ -200,7 +200,8 @@
                         return this.cb.till(key, dateStr);
                 };
 
-                throw new QueryException(841, "Match relation unknown for type");
+                throw new QueryException(841,
+                        "Match relation unknown for type");
             }
 
             // Filter based on string
@@ -216,23 +217,24 @@
                         return this.cb.term(key, json.get("value").asText())
                                 .not();
 
-                        // This may change - but for now it means the elements are lowercased
+                    // This may change - but for now it means the elements are lowercased
                     case "match:contains":
-                        return this.cb.term(key, json.get("value").asText()
-                                .toLowerCase());
+                        return this.cb.term(key,
+                                json.get("value").asText().toLowerCase());
 
                     case "match:containsnot":
                         return this.cb.term(key,
                                 json.get("value").asText().toLowerCase()).not();
 
-                        // <LEGACY>
+                    // <LEGACY>
                     case "match:excludes":
                         return this.cb.term(key,
                                 json.get("value").asText().toLowerCase()).not();
-                        // </LEGACY>
+                    // </LEGACY>
                 };
 
-                throw new QueryException(841, "Match relation unknown for type");
+                throw new QueryException(841,
+                        "Match relation unknown for type");
             }
 
             // Filter based on regex
@@ -254,7 +256,8 @@
                     return this.cb.re(key, json.get("value").asText()).not();
                 };
 
-                throw new QueryException(841, "Match relation unknown for type");
+                throw new QueryException(841,
+                        "Match relation unknown for type");
             };
 
             throw new QueryException(843, "Document type is not supported");
@@ -320,8 +323,8 @@
 
 
     public KrillCollection extend (CollectionBuilder.Interface extension) {
-        return this.fromBuilder(this.cb.orGroup().with(this.cbi)
-                .with(extension));
+        return this
+                .fromBuilder(this.cb.orGroup().with(this.cbi).with(extension));
     };
 
 
@@ -460,8 +463,8 @@
 
             // Init vector
             DocIdSet docids = filter.getDocIdSet(atomic, null);
-            DocIdSetIterator filterIter = (docids == null) ? null : docids
-                    .iterator();
+            DocIdSetIterator filterIter = (docids == null) ? null
+                    : docids.iterator();
 
             if (filterIter == null) {
                 if (!this.cbi.isNegative())
@@ -485,8 +488,8 @@
         };
 
         // Remove deleted docs
-        return (DocIdSet) BitsFilteredDocIdSet.wrap((DocIdSet) new BitDocIdSet(
-                bitset), acceptDocs);
+        return (DocIdSet) BitsFilteredDocIdSet
+                .wrap((DocIdSet) new BitDocIdSet(bitset), acceptDocs);
     };
 
 
@@ -681,72 +684,72 @@
             throws Exception {
         HashMap<String, Long> map = new HashMap<>(100);
         long docNumber = 0, checkNumber = 0;
-
+    
         try {
             if (kc.getCount() <= 0) {
                 checkNumber = (long) this.reader().numDocs();
             };
-
+    
             for (LeafReaderContext atomic : this.reader().leaves()) {
                 HashMap<String, FixedBitSet> termVector = new HashMap<>(20);
-
+    
                 FixedBitSet docvec = kc.bits(atomic);
                 if (docvec != null) {
                     docNumber += docvec.cardinality();
                 };
-
+    
                 Terms terms = atomic.reader().fields().terms(field);
-
+    
                 if (terms == null) {
                     continue;
                 };
-
+    
                 int docLength = atomic.reader().maxDoc();
                 FixedBitSet bitset = new FixedBitSet(docLength);
-
+    
                 // Iterate over all tokens in this field
                 TermsEnum termsEnum = terms.iterator(null);
-
+    
                 while (termsEnum.next() != null) {
-
+    
                     String termString = termsEnum.term().utf8ToString();
-
+    
                     bitset.clear(0, docLength);
-
+    
                     // Get frequency
                     bitset.or((DocIdSetIterator) termsEnum.docs((Bits) docvec,
                             null));
-
+    
                     long value = 0;
                     if (map.containsKey(termString))
                         value = map.get(termString);
-
+    
                     map.put(termString, value + bitset.cardinality());
-
+    
                     termVector.put(termString, bitset.clone());
                 };
-
+    
                 int keySize = termVector.size();
                 String[] keys = termVector.keySet()
                         .toArray(new String[keySize]);
                 java.util.Arrays.sort(keys);
-
+    
                 if (keySize > maxTermRelations) {
                     throw new Exception("termRelations are limited to "
                             + maxTermRelations + " sets"
                             + " (requested were at least " + keySize + " sets)");
                 };
-
+    
                 for (int i = 0; i < keySize; i++) {
                     for (int j = i + 1; j < keySize; j++) {
                         FixedBitSet comby = termVector.get(keys[i]).clone();
                         comby.and(termVector.get(keys[j]));
-
+    
                         StringBuilder sb = new StringBuilder();
                         sb.append("#__").append(keys[i]).append(":###:")
                                 .append(keys[j]);
                         String combString = sb.toString();
-
+    
                         long cap = (long) comby.cardinality();
                         if (map.containsKey(combString)) {
                             cap += map.get(combString);
diff --git a/src/main/java/de/ids_mannheim/korap/KrillIndex.java b/src/main/java/de/ids_mannheim/korap/KrillIndex.java
index d978efc..06713b2 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillIndex.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillIndex.java
@@ -139,8 +139,7 @@
 
     private byte[] pl = new byte[4];
     private static ByteBuffer bb = ByteBuffer.allocate(4),
-            bbOffset = ByteBuffer.allocate(8),
-            bbTerm = ByteBuffer.allocate(16);
+            bbOffset = ByteBuffer.allocate(8), bbTerm = ByteBuffer.allocate(16);
 
     // Some initializations ...
     {
@@ -161,7 +160,8 @@
                 this.autoCommit = Integer.parseInt(autoCommitStr);
             }
             catch (NumberFormatException e) {
-                log.error("krill.index.commit.auto expected to be a numerical value");
+                log.error(
+                        "krill.index.commit.auto expected to be a numerical value");
             };
         };
     };
@@ -547,8 +547,8 @@
             if (gzip) {
 
                 // Create json field document
-                FieldDocument fd = this.mapper.readValue(new GZIPInputStream(
-                        json), FieldDocument.class);
+                FieldDocument fd = this.mapper.readValue(
+                        new GZIPInputStream(json), FieldDocument.class);
                 return fd;
             };
             return this.mapper.readValue(json, FieldDocument.class);
@@ -579,7 +579,8 @@
      * @return The number of the occurrences.
      * @see KrillCollection#numberOf
      */
-    public long numberOf (KrillCollection collection, String field, String type) {
+    public long numberOf (KrillCollection collection, String field,
+            String type) {
 
         collection.setIndex(this);
         try {
@@ -616,11 +617,11 @@
             };
             return docCount;
         };
-
+        
         // Create search term
         // This may be prefixed by foundries
         Term term = new Term(field, "-:" + type);
-
+        
         long occurrences = 0;
         try {
             // Iterate over all atomic readers and collect occurrences
@@ -629,12 +630,12 @@
                         atomic, term);
             };
         }
-
+        
         // Something went wrong
         catch (Exception e) {
             log.warn(e.getLocalizedMessage());
         };
-
+        
         return occurrences;
         */
     };
@@ -702,9 +703,9 @@
         FixedBitSet os = (FixedBitSet) docvec;
         return os.cardinality();
     };
-
+    
     Term term = new Term(field, "-:" + type);
-
+    
     int occurrences = 0;
     try {
         for (LeafReaderContext atomic : this.reader().leaves()) {
@@ -714,7 +715,7 @@
     catch (IOException e) {
         log.warn(e.getLocalizedMessage());
     };
-
+    
     return occurrences;
     };
     */
@@ -783,8 +784,8 @@
         // Rewrite parse ID
         uid = new Integer(Integer.parseInt(uid)).toString();
 
-        Filter filter = (Filter) new QueryWrapperFilter(new TermQuery(new Term(
-                "UID", uid)));
+        Filter filter = (Filter) new QueryWrapperFilter(
+                new TermQuery(new Term("UID", uid)));
 
         try {
 
@@ -792,8 +793,8 @@
             for (LeafReaderContext atomic : this.reader().leaves()) {
 
                 // Retrieve the single document of interest
-                DocIdSet filterSet = filter.getDocIdSet(atomic, atomic.reader()
-                        .getLiveDocs());
+                DocIdSet filterSet = filter.getDocIdSet(atomic,
+                        atomic.reader().getLiveDocs());
 
                 // Create a bitset for the correct document
                 Bits bitset = filterSet.bits();
@@ -858,7 +859,7 @@
                 false,    // includeSpans
                 true,     // includeHighlights
                 false     // extendToSentence
-                );
+        );
     };
 
 
@@ -923,8 +924,7 @@
         // Create a filter based on the corpusID and the docID
         BooleanQuery bool = new BooleanQuery();
         if (match.getTextSigle() != null) {
-            bool.add(
-                    new TermQuery(new Term("textSigle", match.getTextSigle())),
+            bool.add(new TermQuery(new Term("textSigle", match.getTextSigle())),
                     BooleanClause.Occur.MUST);
         }
 
@@ -993,7 +993,8 @@
 
                         // Filter out bad layers
                         for (i = layer.size() - 1; i >= 0; i--) {
-                            if (!harmlessLayer.matcher(layer.get(i)).matches()) {
+                            if (!harmlessLayer.matcher(layer.get(i))
+                                    .matches()) {
                                 throw new QueryException(
                                         "Invalid layer requested: "
                                                 + layer.get(i));
@@ -1040,8 +1041,8 @@
             for (LeafReaderContext atomic : this.reader().leaves()) {
 
                 // Retrieve the single document of interest
-                DocIdSet filterSet = filter.getDocIdSet(atomic, atomic.reader()
-                        .getLiveDocs());
+                DocIdSet filterSet = filter.getDocIdSet(atomic,
+                        atomic.reader().getLiveDocs());
 
 
                 // Create a bitset for the correct document
@@ -1074,8 +1075,8 @@
                 Terms docTerms = atomic.reader().getTermVector(localDocID,
                         field);
 
-                HashSet<String> fields = (HashSet<String>) new Krill()
-                        .getMeta().getFields().clone();
+                HashSet<String> fields = (HashSet<String>) new Krill().getMeta()
+                        .getFields().clone();
 
                 fields.add(field);
 
@@ -1108,7 +1109,8 @@
                     if (DEBUG)
                         log.trace("Extend to sentence element '{}'", element);
 
-                    if (spanContext[0] >= 0 && spanContext[0] < spanContext[1]) {
+                    if (spanContext[0] >= 0
+                            && spanContext[0] < spanContext[1]) {
                         match.setStartPos(spanContext[0]);
                         match.setEndPos(spanContext[1]);
                         match.startMore = false;
@@ -1210,7 +1212,8 @@
             };
         }
         catch (IOException e) {
-            match.addError(600, "Unable to read index", e.getLocalizedMessage());
+            match.addError(600, "Unable to read index",
+                    e.getLocalizedMessage());
             log.warn(e.getLocalizedMessage());
         };
 
@@ -1327,9 +1330,10 @@
             // Revise!
             // Based on core/src/java/org/apache/lucene/search/IndexSearcher.java
             // and highlighter/src/java/org/apache/lucene/search/postingshighlight/PostingsHighlighter.java
-            for (Query rewrittenQuery = query.rewrite(this.reader()); !rewrittenQuery
-                    .equals(query); rewrittenQuery = query.rewrite(this
-                    .reader())) {
+            for (Query rewrittenQuery = query
+                    .rewrite(this.reader()); !rewrittenQuery
+                            .equals(query); rewrittenQuery = query
+                                    .rewrite(this.reader())) {
                 query = (SpanQuery) rewrittenQuery;
             };
 
@@ -1376,7 +1380,8 @@
                     if (itemsPerResource > 0) {
 
                         // IDS are identical
-                        if (localDocID == oldLocalDocID || oldLocalDocID == -1) {
+                        if (localDocID == oldLocalDocID
+                                || oldLocalDocID == -1) {
                             if (itemsPerResourceCounter++ >= itemsPerResource) {
                                 if (spans.skipTo(localDocID + 1) != true) {
                                     break;
@@ -1402,8 +1407,9 @@
                     docID = atomic.docBase + localDocID;
 
                     // Do not load all of this, in case the doc is the same!
-                    final Document doc = (fields != null) ? lreader.document(
-                            localDocID, fields) : lreader.document(localDocID);
+                    final Document doc = (fields != null)
+                            ? lreader.document(localDocID, fields)
+                            : lreader.document(localDocID);
 
                     // Create new Match
                     final Match match = new Match(pto, localDocID,
@@ -1461,7 +1467,8 @@
                             break;
 
                         // IDS are identical
-                        if (localDocID == oldLocalDocID || oldLocalDocID == -1) {
+                        if (localDocID == oldLocalDocID
+                                || oldLocalDocID == -1) {
                             if (localDocID == -1)
                                 break;
 
@@ -1549,8 +1556,9 @@
         try {
 
             // Rewrite query (for regex and wildcard queries)
-            for (Query rewrittenQuery = query.rewrite(this.reader()); rewrittenQuery != (Query) query; rewrittenQuery = query
-                    .rewrite(this.reader())) {
+            for (Query rewrittenQuery = query.rewrite(
+                    this.reader()); rewrittenQuery != (Query) query; rewrittenQuery = query
+                            .rewrite(this.reader())) {
                 query = (SpanQuery) rewrittenQuery;
             };
 
@@ -1596,8 +1604,8 @@
                         };
 
                         // Read document id from index
-                        uniqueDocIDString = lreader
-                                .document(localDocID, fields).get("UID");
+                        uniqueDocIDString = lreader.document(localDocID, fields)
+                                .get("UID");
 
                         if (uniqueDocIDString != null)
                             uniqueDocID = Integer.parseInt(uniqueDocIDString);
diff --git a/src/main/java/de/ids_mannheim/korap/KrillMeta.java b/src/main/java/de/ids_mannheim/korap/KrillMeta.java
index c6bb0a4..a6aaade 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillMeta.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillMeta.java
@@ -43,9 +43,9 @@
 
         // Lift following fields per default
         // These fields are chosen for <legacy /> reasons
-        for (String field : new String[] { "ID", "UID", "textSigle",
-                "corpusID", "author", "title", "subTitle", "textClass",
-                "pubPlace", "pubDate",
+        for (String field : new String[] { "ID", "UID", "textSigle", "corpusID",
+                "author", "title", "subTitle", "textClass", "pubPlace",
+                "pubDate",
                 // "foundries",
                 // "tokenization",
                 // New:
diff --git a/src/main/java/de/ids_mannheim/korap/KrillQuery.java b/src/main/java/de/ids_mannheim/korap/KrillQuery.java
index 19fd398..45f1dda 100644
--- a/src/main/java/de/ids_mannheim/korap/KrillQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/KrillQuery.java
@@ -156,11 +156,11 @@
      * SpanQueryWrapper sqw = kq.fromKoral(
      * "{\"@type\" : \"koral:token\","+
      * "\"wrap\" : {" +
-     * "\"@type\" :   \"koral:term\"," +
+     * "\"@type\" : \"koral:term\"," +
      * "\"foundry\" : \"opennlp\"," +
-     * "\"key\" :     \"tree\"," +
-     * "\"layer\" :   \"orth\"," +
-     * "\"match\" :   \"match:eq\""+
+     * "\"key\" : \"tree\"," +
+     * "\"layer\" : \"orth\"," +
+     * "\"match\" : \"match:eq\""+
      * "}}"
      * );
      * </pre></blockquote>
@@ -231,10 +231,10 @@
                 return this._groupFromJson(json);
 
             case "koral:reference":
-                if (json.has("operation")
-                        && !json.get("operation").asText()
-                                .equals("operation:focus"))
-                    throw new QueryException(712, "Unknown reference operation");
+                if (json.has("operation") && !json.get("operation").asText()
+                        .equals("operation:focus"))
+                    throw new QueryException(712,
+                            "Unknown reference operation");
 
                 if (!json.has("operands")) {
                     throw new QueryException(766,
@@ -293,14 +293,13 @@
                     SpanSubspanQueryWrapper ssqw = new SpanSubspanQueryWrapper(
                             sqw, startOffset, length);
                     return ssqw;
-                }
-                ;
+                };
 
                 if (DEBUG)
                     log.trace("Wrap class reference {}", number);
 
-                return new SpanFocusQueryWrapper(this._fromKoral(operands
-                        .get(0)), number);
+                return new SpanFocusQueryWrapper(
+                        this._fromKoral(operands.get(0)), number);
 
             case "koral:token":
 
@@ -446,10 +445,10 @@
                 // Deprecated in favor of operation:junction
             case "operation:or":
                 return this._operationJunctionFromJson(operands);
-                /*
-                  case "operation:submatch": // Deprecated in favor of koral:reference
-                  return this._operationSubmatchFromJson(json, operands);
-                */
+            /*
+              case "operation:submatch": // Deprecated in favor of koral:reference
+              return this._operationSubmatchFromJson(json, operands);
+            */
             case "operation:disjunction":
                 return this._operationJunctionFromJson(operands);
         };
@@ -469,11 +468,9 @@
         for (int i = 0; i < operands.size(); i++) {
             childNode = operands.get(i);
             if (childNode.has("@type")
-                    && childNode.get("@type").asText()
-                            .equals("koral:reference")
-                    && childNode.has("operation")
-                    && childNode.get("operation").asText()
-                            .equals("operation:focus")
+                    && childNode.get("@type").asText().equals("koral:reference")
+                    && childNode.has("operation") && childNode.get("operation")
+                            .asText().equals("operation:focus")
                     && !childNode.has("operands")) {
 
                 if (childNode.has("classRef")) {
@@ -963,7 +960,8 @@
         // inOrder was set to false without a distance constraint
         if (!sseqqw.isInOrder() && !sseqqw.hasConstraints()) {
             if (DEBUG)
-                log.trace("Add distance constraint - for the normal inorder case");
+                log.trace(
+                        "Add distance constraint - for the normal inorder case");
 
             sseqqw.withConstraint(1, 1, "w");
         };
@@ -973,7 +971,8 @@
 
 
     // Deserialize koral:token
-    private SpanQueryWrapper _segFromJson (JsonNode json) throws QueryException {
+    private SpanQueryWrapper _segFromJson (JsonNode json)
+            throws QueryException {
 
         if (!json.has("@type"))
             throw new QueryException(701,
@@ -1006,9 +1005,9 @@
                 //
                 //            case "match:eq":
                 return this._termFromJson(json);
-                //            };
-                //
-                //            throw new QueryException(741, "Match relation unknown");
+            //            };
+            //
+            //            throw new QueryException(741, "Match relation unknown");
 
             case "koral:termGroup":
 
@@ -1043,8 +1042,7 @@
                                 throw new QueryException(744,
                                         "Operand not supported in term group");
                             };
-                        }
-                        ;
+                        };
                         return ssegqw;
 
                     case "relation:or":
@@ -1053,11 +1051,9 @@
                                 this.field);
                         for (JsonNode operand : operands) {
                             ssaq.or(this._segFromJson(operand));
-                        }
-                        ;
+                        };
                         return ssaq;
-                }
-                ;
+                };
         };
         throw new QueryException(745, "Token type is not supported");
     };
@@ -1193,23 +1189,23 @@
 
             // Branch on type
             switch (json.get("type").asText()) {
-			case "type:regex": {
+                case "type:regex": {
 
-				// The regex can be rewritten to an any token
-				if (value.toString().matches("^[si]:\\.[\\+\\*]\\??$")) {
-					return new SpanRepetitionQueryWrapper();
-				};
-				return qb.seg(qb.re(value.toString(), isCaseInsensitive));
-			}
-			case "type:wildcard":
-				return qb.seq(qb.wc(value.toString(), isCaseInsensitive));
+                    // The regex can be rewritten to an any token
+                    if (value.toString().matches("^[si]:\\.[\\+\\*]\\??$")) {
+                        return new SpanRepetitionQueryWrapper();
+                    };
+                    return qb.seg(qb.re(value.toString(), isCaseInsensitive));
+                }
+                case "type:wildcard":
+                    return qb.seq(qb.wc(value.toString(), isCaseInsensitive));
 
-			case "type:string":
-				break;
+                case "type:string":
+                    break;
 
-			default:
-				this.addWarning(746,
-								"Term type is not supported - treated as a string");
+                default:
+                    this.addWarning(746,
+                            "Term type is not supported - treated as a string");
             };
         };
 
@@ -1248,8 +1244,8 @@
                 // "Arbitraty elements with attributes are currently not supported.");
             }
             else {
-                SpanQueryWrapper elementWithIdWrapper = this.builder().tag(
-                        value.toString());
+                SpanQueryWrapper elementWithIdWrapper = this.builder()
+                        .tag(value.toString());
                 if (elementWithIdWrapper == null) {
                     return null;
                 }
@@ -1366,9 +1362,8 @@
 
                 // TODO: Here do not refer to 'tokens'!!!
                 // EM: what should it be? property?
-                return new SpanAttributeQueryWrapper(
-                        new SpanSimpleQueryWrapper("tokens", "@root",
-                                Boolean.valueOf(rootValue)));
+                return new SpanAttributeQueryWrapper(new SpanSimpleQueryWrapper(
+                        "tokens", "@root", Boolean.valueOf(rootValue)));
             }
         }
         return null;
diff --git a/src/main/java/de/ids_mannheim/korap/collection/BooleanGroupFilter.java b/src/main/java/de/ids_mannheim/korap/collection/BooleanGroupFilter.java
index 2143664..475b5be 100644
--- a/src/main/java/de/ids_mannheim/korap/collection/BooleanGroupFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/collection/BooleanGroupFilter.java
@@ -104,8 +104,8 @@
 
     @Override
     public String toString () {
-        StringBuilder buffer = new StringBuilder(this.isOptional ? "OrGroup("
-                : "AndGroup(");
+        StringBuilder buffer = new StringBuilder(
+                this.isOptional ? "OrGroup(" : "AndGroup(");
         boolean first = true;
         for (final GroupFilterOperand operand : this.operands) {
             if (first)
@@ -168,8 +168,8 @@
                             log.debug("- Filter to allow all documents");
 
                         bitset.set(0, maxDoc);
-                        return BitsFilteredDocIdSet.wrap(
-                                new BitDocIdSet(bitset), acceptDocs);
+                        return BitsFilteredDocIdSet
+                                .wrap(new BitDocIdSet(bitset), acceptDocs);
                     };
 
                     // There is no possible match
diff --git a/src/main/java/de/ids_mannheim/korap/collection/CollectionBuilder.java b/src/main/java/de/ids_mannheim/korap/collection/CollectionBuilder.java
index 350d852..d3ade8b 100644
--- a/src/main/java/de/ids_mannheim/korap/collection/CollectionBuilder.java
+++ b/src/main/java/de/ids_mannheim/korap/collection/CollectionBuilder.java
@@ -58,7 +58,8 @@
             if (till == 0 || till == KrillDate.END)
                 return null;
 
-            return new CollectionBuilder.Range(field, KrillDate.BEGINNING, till);
+            return new CollectionBuilder.Range(field, KrillDate.BEGINNING,
+                    till);
         }
         catch (NumberFormatException e) {
             log.warn("Parameter of till(date) is invalid");
@@ -99,7 +100,8 @@
             return new CollectionBuilder.Range(field, begin, end);
         };
 
-        return new CollectionBuilder.Range(field, dateDF.floor(), dateDF.ceil());
+        return new CollectionBuilder.Range(field, dateDF.floor(),
+                dateDF.ceil());
     };
 
 
@@ -153,8 +155,8 @@
                                 this.field, this.term)));
 
             // Simple term
-            return new TermsFilter(new org.apache.lucene.index.Term(this.field,
-                    this.term));
+            return new TermsFilter(
+                    new org.apache.lucene.index.Term(this.field, this.term));
         };
 
 
diff --git a/src/main/java/de/ids_mannheim/korap/index/AbstractDocument.java b/src/main/java/de/ids_mannheim/korap/index/AbstractDocument.java
index b293a47..d367382 100644
--- a/src/main/java/de/ids_mannheim/korap/index/AbstractDocument.java
+++ b/src/main/java/de/ids_mannheim/korap/index/AbstractDocument.java
@@ -44,7 +44,7 @@
     public int internalDocID, localDocID, UID;
 
     private KrillDate pubDate,
-    // newly added
+            // newly added
             creationDate;
 
     private HashMap<String, String> fieldMap;
@@ -52,28 +52,17 @@
     private String
 
     // No longer supported
-            ID,
-            corpusID,
-            field,
-            layerInfo,
-            tokenization,
+    ID, corpusID, field, layerInfo, tokenization,
 
             // Still supported
-            foundries,
-            textClass,
-            pubPlace,
+            foundries, textClass, pubPlace,
 
             // Newly added for the corpus/doc/text distinction of DeReKo
-            textSigle, docSigle, corpusSigle, title, subTitle, author,
-            editor,
-            docTitle, docSubTitle, docAuthor, docEditor,
-            corpusTitle,
-            corpusSubTitle, corpusAuthor, corpusEditor, textType,
-            textTypeArt,
-            textTypeRef, textColumn, textDomain,
-            fileEditionStatement,
-            biblEditionStatement, publisher, reference, language,
-            license,
+            textSigle, docSigle, corpusSigle, title, subTitle, author, editor,
+            docTitle, docSubTitle, docAuthor, docEditor, corpusTitle,
+            corpusSubTitle, corpusAuthor, corpusEditor, textType, textTypeArt,
+            textTypeRef, textColumn, textDomain, fileEditionStatement,
+            biblEditionStatement, publisher, reference, language, license,
             pages, keywords,
 
             // Meta information regarding annotations
diff --git a/src/main/java/de/ids_mannheim/korap/index/Indexer.java b/src/main/java/de/ids_mannheim/korap/index/Indexer.java
index c5da39b..b5dfd20 100644
--- a/src/main/java/de/ids_mannheim/korap/index/Indexer.java
+++ b/src/main/java/de/ids_mannheim/korap/index/Indexer.java
@@ -71,7 +71,8 @@
 
                 // Add file to the index
                 try {
-                    if (this.index.addDoc(new FileInputStream(found), true) == null) {
+                    if (this.index.addDoc(new FileInputStream(found),
+                            true) == null) {
                         System.out.println("fail.");
                         continue;
                     };
@@ -121,8 +122,8 @@
             String jar = new File(Indexer.class.getProtectionDomain()
                     .getCodeSource().getLocation().getPath()).getName();
 
-            System.out
-                    .println("Add documents from a directory to the Krill index.");
+            System.out.println(
+                    "Add documents from a directory to the Krill index.");
             System.out.println("Usage: java -jar " + jar
                     + " [--config propfile] [directories]*");
             System.out.println();
diff --git a/src/main/java/de/ids_mannheim/korap/index/MultiTerm.java b/src/main/java/de/ids_mannheim/korap/index/MultiTerm.java
index b009e7b..e4eb624 100644
--- a/src/main/java/de/ids_mannheim/korap/index/MultiTerm.java
+++ b/src/main/java/de/ids_mannheim/korap/index/MultiTerm.java
@@ -158,7 +158,8 @@
      * @return The {@link MultiTerm} object for chaining.
      */
     public MultiTerm setPayload (short pl) {
-        this.payload = new BytesRef(ByteBuffer.allocate(2).putShort(pl).array());
+        this.payload = new BytesRef(
+                ByteBuffer.allocate(2).putShort(pl).array());
         return this;
     };
 
@@ -321,8 +322,8 @@
                 sb.append(this.payload.utf8ToString());
             }
             catch (AssertionError e) {
-                sb.append("<?>").append(
-                        this.payload.toString().replace(' ', ','));
+                sb.append("<?>")
+                        .append(this.payload.toString().replace(' ', ','));
             };
         };
 
@@ -364,8 +365,8 @@
                 sb.append(this.payload.utf8ToString());
             }
             catch (AssertionError e) {
-                sb.append("<?>").append(
-                        this.payload.toString().replace(' ', ','));
+                sb.append("<?>")
+                        .append(this.payload.toString().replace(' ', ','));
             };
         };
         return sb.toString();
@@ -398,8 +399,8 @@
 
                         // Resize the bytebuffer
                         if ((bb.capacity() - l) < 8) {
-                            bb = ByteBuffer.allocate(bb.capacity() + 8).put(
-                                    bb.array());
+                            bb = ByteBuffer.allocate(bb.capacity() + 8)
+                                    .put(bb.array());
                             bb.position(l);
                         };
 
@@ -479,7 +480,7 @@
 
     // Unescape the term
     private String _unescape (String term) {
-        return term.replace("\\\\", "\\").replace("\\#", "#")
-                .replace("\\$", "$");
+        return term.replace("\\\\", "\\").replace("\\#", "#").replace("\\$",
+                "$");
     };
 };
diff --git a/src/main/java/de/ids_mannheim/korap/index/MultiTermTokenStream.java b/src/main/java/de/ids_mannheim/korap/index/MultiTermTokenStream.java
index f02b074..50e39aa 100644
--- a/src/main/java/de/ids_mannheim/korap/index/MultiTermTokenStream.java
+++ b/src/main/java/de/ids_mannheim/korap/index/MultiTermTokenStream.java
@@ -153,7 +153,8 @@
      *            A surface string of a {@link MultiTerm}.
      * @return The {@link MultiTermTokenStream} object for chaining.
      */
-    public MultiTermTokenStream addMultiTermToken (char prefix, String surface) {
+    public MultiTermTokenStream addMultiTermToken (char prefix,
+            String surface) {
         return this.addMultiTermToken(new MultiTermToken(prefix, surface));
     };
 
diff --git a/src/main/java/de/ids_mannheim/korap/index/PositionsToOffset.java b/src/main/java/de/ids_mannheim/korap/index/PositionsToOffset.java
index bd84972..c471c51 100644
--- a/src/main/java/de/ids_mannheim/korap/index/PositionsToOffset.java
+++ b/src/main/java/de/ids_mannheim/korap/index/PositionsToOffset.java
@@ -161,8 +161,8 @@
 
 
     public void addOffset (int docID, int pos, int startOffset, int endOffset) {
-        offsets.put(new PositionsToOffsetArray(docID, pos), new Integer[] {
-                startOffset, endOffset });
+        offsets.put(new PositionsToOffsetArray(docID, pos),
+                new Integer[] { startOffset, endOffset });
     };
 
 
@@ -233,8 +233,7 @@
                             }
 
                             else {
-                                log.error(
-                                        "Doc {} has no offsets stored for {}",
+                                log.error("Doc {} has no offsets stored for {}",
                                         docID, term.toString());
                             };
                         };
diff --git a/src/main/java/de/ids_mannheim/korap/index/TermInfo.java b/src/main/java/de/ids_mannheim/korap/index/TermInfo.java
index dc7403a..3f05ea8 100644
--- a/src/main/java/de/ids_mannheim/korap/index/TermInfo.java
+++ b/src/main/java/de/ids_mannheim/korap/index/TermInfo.java
@@ -68,8 +68,7 @@
                     this.type = "relTarget";
                     tterm = tterm.substring(2);
                     ttype = 3;
-                }
-                ;
+                };
                 break;
 
             case '>':
diff --git a/src/main/java/de/ids_mannheim/korap/query/DistanceConstraint.java b/src/main/java/de/ids_mannheim/korap/query/DistanceConstraint.java
index 7a87bdd..279131f 100644
--- a/src/main/java/de/ids_mannheim/korap/query/DistanceConstraint.java
+++ b/src/main/java/de/ids_mannheim/korap/query/DistanceConstraint.java
@@ -53,7 +53,7 @@
  * </ol>
  * 
  * @author margaretha
- * */
+ */
 
 public class DistanceConstraint {
     private int minDistance, maxDistance;
diff --git a/src/main/java/de/ids_mannheim/korap/query/FrameConstraint.java b/src/main/java/de/ids_mannheim/korap/query/FrameConstraint.java
index e0c3dd6..ba90a77 100644
--- a/src/main/java/de/ids_mannheim/korap/query/FrameConstraint.java
+++ b/src/main/java/de/ids_mannheim/korap/query/FrameConstraint.java
@@ -60,9 +60,8 @@
     public static final int PRECEDES = 1, PRECEDES_DIRECTLY = 1 << 1,
             OVERLAPS_LEFT = 1 << 2, ALIGNS_LEFT = 1 << 3, STARTS_WITH = 1 << 4,
             MATCHES = 1 << 5, IS_WITHIN = 1 << 6, IS_AROUND = 1 << 7,
-            ENDS_WITH = 1 << 8, ALIGNS_RIGHT = 1 << 9,
-            OVERLAPS_RIGHT = 1 << 10, SUCCEEDS_DIRECTLY = 1 << 11,
-            SUCCEEDS = 1 << 12, ALL = 1024 * 8 - 1;
+            ENDS_WITH = 1 << 8, ALIGNS_RIGHT = 1 << 9, OVERLAPS_RIGHT = 1 << 10,
+            SUCCEEDS_DIRECTLY = 1 << 11, SUCCEEDS = 1 << 12, ALL = 1024 * 8 - 1;
 
 
     private static final Map<String, Integer> FRAME;
@@ -113,7 +112,8 @@
          * a.end < b.end && a.start == b.start
          */
         FRAME_t.put("alignsLeft", ALIGNS_LEFT);
-        NEXT_B_t.add(PRECEDES | PRECEDES_DIRECTLY | OVERLAPS_LEFT | ALIGNS_LEFT);
+        NEXT_B_t.add(
+                PRECEDES | PRECEDES_DIRECTLY | OVERLAPS_LEFT | ALIGNS_LEFT);
 
         /*
          * A starts with B
@@ -338,6 +338,7 @@
     // Todo: create nextB arraymatrix by adding all combinations of constellation precomputed
     // NEXTB[SUCCEEDS_DIRECTLY | SUCCEEDS] = NEXTB[SUCEEDS_DIRECTLY] | NEXTB[SUCCEEDS];
 
+
     // NextB
     // Integer.numberOfTrailingZeros();
     private static int _next_b (int constellation) {
diff --git a/src/main/java/de/ids_mannheim/korap/query/QueryBuilder.java b/src/main/java/de/ids_mannheim/korap/query/QueryBuilder.java
index 96e4eb5..f065737 100644
--- a/src/main/java/de/ids_mannheim/korap/query/QueryBuilder.java
+++ b/src/main/java/de/ids_mannheim/korap/query/QueryBuilder.java
@@ -132,7 +132,8 @@
      */
     public SpanRegexQueryWrapper re (String re, int flags,
             boolean caseinsensitive) {
-        return new SpanRegexQueryWrapper(this.field, re, flags, caseinsensitive);
+        return new SpanRegexQueryWrapper(this.field, re, flags,
+                caseinsensitive);
     };
 
 
@@ -257,7 +258,7 @@
         return ssq;
     };
 
-	
+
     /**
      * Create an empty query segment.
      * 
@@ -312,7 +313,8 @@
      *            [] An array of segment defining terms.
      */
     public SpanSequenceQueryWrapper seq (SpanQueryWrapper ... terms) {
-        SpanSequenceQueryWrapper sssq = new SpanSequenceQueryWrapper(this.field);
+        SpanSequenceQueryWrapper sssq = new SpanSequenceQueryWrapper(
+                this.field);
         for (SpanQueryWrapper t : terms)
             sssq.append(t);
         return sssq;
@@ -431,7 +433,8 @@
     };
 
 
-    public SpanFocusQueryWrapper focus (short number, SpanQueryWrapper element) {
+    public SpanFocusQueryWrapper focus (short number,
+            SpanQueryWrapper element) {
         return new SpanFocusQueryWrapper(element, number);
     };
 
@@ -448,8 +451,8 @@
     };
 
 
-    public SpanRepetitionQueryWrapper repeat (SpanQueryWrapper element,
-            int min, int max) {
+    public SpanRepetitionQueryWrapper repeat (SpanQueryWrapper element, int min,
+            int max) {
         return new SpanRepetitionQueryWrapper(element, min, max);
     };
 };
diff --git a/src/main/java/de/ids_mannheim/korap/query/SimpleSpanQuery.java b/src/main/java/de/ids_mannheim/korap/query/SimpleSpanQuery.java
index 7e428a4..919022e 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SimpleSpanQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SimpleSpanQuery.java
@@ -67,7 +67,7 @@
  * @see SpanQuery
  * 
  * @author margaretha
- * */
+ */
 public abstract class SimpleSpanQuery extends SpanQuery implements Cloneable {
 
     protected SpanQuery firstClause = null, secondClause = null;
@@ -91,7 +91,7 @@
      *            <code>true</code> if payloads are to be collected,
      *            otherwise
      *            <code>false</code>.
-     * */
+     */
     public SimpleSpanQuery (SpanQuery firstClause, boolean collectPayloads) {
         if (firstClause == null) {
             throw new IllegalArgumentException(
@@ -117,7 +117,7 @@
      *            <code>true</code> if payloads are to be collected,
      *            otherwise
      *            <code>false</code>.
-     * */
+     */
     public SimpleSpanQuery (SpanQuery firstClause, SpanQuery secondClause,
                             boolean collectPayloads) {
         this(firstClause, collectPayloads);
@@ -144,7 +144,7 @@
      *            <code>true</code> if payloads are to be collected,
      *            otherwise
      *            <code>false</code>.
-     * */
+     */
     public SimpleSpanQuery (SpanQuery firstClause,
                             List<SpanQuery> secondClauses,
                             boolean collectPayloads) {
@@ -209,7 +209,7 @@
 
     /**
      * {@inheritDoc}
-     * */
+     */
     @Override
     public String getField () {
         return field;
@@ -339,8 +339,8 @@
             throws IOException {
 
         for (int i = 0; i < spanQueries.size(); i++) {
-            final SpanQuery query = (SpanQuery) spanQueries.get(i).rewrite(
-                    reader);
+            final SpanQuery query = (SpanQuery) spanQueries.get(i)
+                    .rewrite(reader);
             if (!query.equals(spanQueries.get(i))) {
                 if (clone == null)
                     clone = clone();
@@ -381,7 +381,7 @@
 
     /**
      * {@inheritDoc}
-     * */
+     */
     // Used in rewriting query
     @Override
     public boolean equals (Object o) {
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanAttributeQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanAttributeQuery.java
index 265d2de..0ae6922 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanAttributeQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanAttributeQuery.java
@@ -42,7 +42,7 @@
  * </pre>
  * 
  * @author margaretha
- * */
+ */
 public class SpanAttributeQuery extends SimpleSpanQuery {
 
     boolean negation;
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanDistanceQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanDistanceQuery.java
index da53af7..88c4de1 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanDistanceQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanDistanceQuery.java
@@ -106,14 +106,14 @@
  * 
  * 
  * @author margaretha
- * */
+ */
 public class SpanDistanceQuery extends SimpleSpanQuery {
 
     private boolean exclusion;
     private boolean isOrdered;
     private int minDistance, maxDistance;
     private SpanElementQuery elementQuery; // element distance unit (sentence or
-                                           // paragraph)
+                                          // paragraph)
     private String distanceUnit;
     private String spanName;
     private DistanceConstraint constraint;
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanExpansionQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanExpansionQuery.java
index d7130e1..2d6c29f 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanExpansionQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanExpansionQuery.java
@@ -97,7 +97,7 @@
  * together with a class number.
  * 
  * @author margaretha
- * */
+ */
 public class SpanExpansionQuery extends SimpleSpanQuery {
 
     private int min, max; // min, max expansion position
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanMultipleDistanceQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanMultipleDistanceQuery.java
index 51ba29b..ce65df6 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanMultipleDistanceQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanMultipleDistanceQuery.java
@@ -73,7 +73,7 @@
  * </ul>
  * 
  * @author margaretha
- * */
+ */
 public class SpanMultipleDistanceQuery extends SimpleSpanQuery {
 
     private List<DistanceConstraint> constraints;
@@ -106,7 +106,8 @@
     public SpanMultipleDistanceQuery (SpanQuery firstClause,
                                       SpanQuery secondClause,
                                       List<DistanceConstraint> constraints,
-                                      boolean isOrdered, boolean collectPayloads) {
+                                      boolean isOrdered,
+                                      boolean collectPayloads) {
         super(firstClause, secondClause, collectPayloads);
         this.constraints = constraints;
         this.isOrdered = isOrdered;
@@ -165,7 +166,7 @@
      * meeting all the constraints.
      * 
      * @return only the span matches meeting all the constraints.
-     * */
+     */
     @Override
     public Spans getSpans (LeafReaderContext context, Bits acceptDocs,
             Map<Term, TermContext> termContexts) throws IOException {
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanRelationMatchQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanRelationMatchQuery.java
index 151abf4..311a5fc 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanRelationMatchQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanRelationMatchQuery.java
@@ -23,44 +23,47 @@
                                    SpanQuery operand, boolean collectPayloads) {
 
         checkVariables(relation, operand);
-        SpanFocusQuery sq = new SpanFocusQuery(new SpanSegmentQuery(
-                relationQuery, operandQuery, true),
+        SpanFocusQuery sq = new SpanFocusQuery(
+                new SpanSegmentQuery(relationQuery, operandQuery, true),
                 relation.getTempClassNumbers());
         sq.setMatchTemporaryClass(true);
         sq.setRemoveTemporaryClasses(true);
         sq.setSorted(false); // which operand to focus might be
-                             // different from that to match
+                            // different from that to match
 
         this.setFirstClause(sq);
         this.collectPayloads = collectPayloads;
     }
 
 
-    public SpanRelationMatchQuery (SpanRelationQuery relation,
-                                   SpanQuery source, SpanQuery target,
-                                   boolean collectPayloads) {
+    public SpanRelationMatchQuery (SpanRelationQuery relation, SpanQuery source,
+                                   SpanQuery target, boolean collectPayloads) {
 
         checkVariables(relation, source, target);
         SpanFocusQuery sq = null;
         SpanFocusQuery sq2 = null;
         // match source and then target
         if (relationQuery.getDirection() == 0) {
-            sq = new SpanFocusQuery(new SpanSegmentQuery(relationQuery,
-                    operandQuery, true), relation.getTempTargetNum());
+            sq = new SpanFocusQuery(
+                    new SpanSegmentQuery(relationQuery, operandQuery, true),
+                    relation.getTempTargetNum());
             sq.setSorted(false);
             sq.setMatchTemporaryClass(true);
 
-            sq2 = new SpanFocusQuery(new SpanSegmentQuery(operand2Query, sq,
-                    true), relation.getTempClassNumbers());
+            sq2 = new SpanFocusQuery(
+                    new SpanSegmentQuery(operand2Query, sq, true),
+                    relation.getTempClassNumbers());
         }
         // match target and then source
         else {
-            sq = new SpanFocusQuery(new SpanSegmentQuery(relationQuery,
-                    operandQuery, true), relation.getTempSourceNum());
+            sq = new SpanFocusQuery(
+                    new SpanSegmentQuery(relationQuery, operandQuery, true),
+                    relation.getTempSourceNum());
             sq.setMatchTemporaryClass(true);
 
-            sq2 = new SpanFocusQuery(new SpanSegmentQuery(sq, operand2Query,
-                    true), relation.getTempClassNumbers());
+            sq2 = new SpanFocusQuery(
+                    new SpanSegmentQuery(sq, operand2Query, true),
+                    relation.getTempClassNumbers());
         }
 
         sq2.setMatchTemporaryClass(true);
@@ -128,8 +131,8 @@
     public Spans getSpans (LeafReaderContext context, Bits acceptDocs,
             Map<Term, TermContext> termContexts) throws IOException {
 
-        return new FocusSpans((SpanFocusQuery) firstClause, context,
-                acceptDocs, termContexts);
+        return new FocusSpans((SpanFocusQuery) firstClause, context, acceptDocs,
+                termContexts);
     }
 
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanRelationQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanRelationQuery.java
index a2f565c..094e457 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanRelationQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanRelationQuery.java
@@ -54,7 +54,7 @@
  * </ol>
  * 
  * @author margaretha
- * */
+ */
 public class SpanRelationQuery extends SimpleSpanQuery {
 
     private int direction = 0; // >
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanRepetitionQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanRepetitionQuery.java
index 92c6c94..c169e4b 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanRepetitionQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanRepetitionQuery.java
@@ -47,7 +47,7 @@
  * </pre>
  * 
  * @author margaretha
- * */
+ */
 public class SpanRepetitionQuery extends SimpleSpanQuery {
 
     private int min, max;
@@ -72,6 +72,10 @@
     public SpanRepetitionQuery (SpanQuery sq, int min, int max,
                                 boolean collectPayloads) {
         super(sq, collectPayloads);
+        if (min < 1) {
+            throw new IllegalArgumentException(
+                    "Minimum repetition must not lower than 1.");
+        }
         this.min = min;
         this.max = max;
     }
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanSegmentQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanSegmentQuery.java
index 508c7ca..9e36c40 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanSegmentQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanSegmentQuery.java
@@ -26,7 +26,7 @@
  * </pre>
  * 
  * @author margaretha
- * */
+ */
 public class SpanSegmentQuery extends SimpleSpanQuery {
 
     private boolean isRelation;
@@ -72,7 +72,8 @@
     @Override
     public Spans getSpans (LeafReaderContext context, Bits acceptDocs,
             Map<Term, TermContext> termContexts) throws IOException {
-        return (Spans) new SegmentSpans(this, context, acceptDocs, termContexts);
+        return (Spans) new SegmentSpans(this, context, acceptDocs,
+                termContexts);
     }
 
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanSubspanQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanSubspanQuery.java
index 9ec9632..5d31352 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanSubspanQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanSubspanQuery.java
@@ -36,7 +36,7 @@
  * two tokens of all sentences.
  * 
  * @author margaretha
- * */
+ */
 public class SpanSubspanQuery extends SimpleSpanQuery {
 
     private int startOffset, length;
@@ -60,8 +60,8 @@
      *            otherwise
      *            <code>false</code>.
      */
-    public SpanSubspanQuery (SpanQuery firstClause, int startOffset,
-                             int length, boolean collectPayloads) {
+    public SpanSubspanQuery (SpanQuery firstClause, int startOffset, int length,
+                             boolean collectPayloads) {
         super(firstClause, collectPayloads);
         this.startOffset = startOffset;
         this.length = length;
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanTermWithIdQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanTermWithIdQuery.java
index 324d560..51ae8d1 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanTermWithIdQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanTermWithIdQuery.java
@@ -30,7 +30,7 @@
  * the Term "tt:p/NN".
  * 
  * @author margaretha
- * */
+ */
 public class SpanTermWithIdQuery extends SimpleSpanQuery {
 
     /**
diff --git a/src/main/java/de/ids_mannheim/korap/query/SpanWithAttributeQuery.java b/src/main/java/de/ids_mannheim/korap/query/SpanWithAttributeQuery.java
index fae7aa0..915ac3a 100644
--- a/src/main/java/de/ids_mannheim/korap/query/SpanWithAttributeQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/SpanWithAttributeQuery.java
@@ -199,8 +199,8 @@
                     termContexts);
         }
 
-        SimpleSpans spans = (SimpleSpans) this.getFirstClause().getSpans(
-                context, acceptDocs, termContexts);
+        SimpleSpans spans = (SimpleSpans) this.getFirstClause()
+                .getSpans(context, acceptDocs, termContexts);
         return new SpansWithAttribute(this, spans, context, acceptDocs,
                 termContexts);
     }
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/AttributeSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/AttributeSpans.java
index 4958bea..ab0576f 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/AttributeSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/AttributeSpans.java
@@ -43,7 +43,7 @@
  * "any element having a specific attribute".
  * 
  * @author margaretha
- * */
+ */
 public class AttributeSpans extends SimpleSpans {
 
     private List<CandidateAttributeSpan> candidateList;
@@ -243,9 +243,9 @@
      * The
      * attributes with smaller spanIds come first on the list.
      * 
-     * */
-    class CandidateAttributeSpan extends CandidateSpan implements
-            Comparable<CandidateSpan> {
+     */
+    class CandidateAttributeSpan extends CandidateSpan
+            implements Comparable<CandidateSpan> {
 
         /**
          * Construct a CandidateAttributeSpan based on the given span,
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/CandidateSpan.java b/src/main/java/de/ids_mannheim/korap/query/spans/CandidateSpan.java
index b132dc7..83e8ba4 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/CandidateSpan.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/CandidateSpan.java
@@ -15,14 +15,14 @@
  * matching.
  * 
  * @author margaretha
- * */
+ */
 public class CandidateSpan implements Comparable<CandidateSpan>, Cloneable {
     protected int doc, start, end;
     private long cost;
     private Collection<byte[]> payloads;
     private int position;
     private CandidateSpan childSpan; // used for example for multiple distance
-                                     // with unordered constraint
+                                    // with unordered constraint
     protected short spanId;
     protected boolean hasSpanId;
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/ClassFilteredSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/ClassFilteredSpans.java
index 71e8e42..406247f 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/ClassFilteredSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/ClassFilteredSpans.java
@@ -56,8 +56,8 @@
     private boolean isClassOperationValid () throws IOException {
         setBitsets();
 
-        int cardinality = Math
-                .max(bitset1.cardinality(), bitset2.cardinality());
+        int cardinality = Math.max(bitset1.cardinality(),
+                bitset2.cardinality());
 
         bitset1.and(bitset2);
         // System.out.println("cardinality:" + cardinality);
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/ClassSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/ClassSpans.java
index 47a6998..42e59a1 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/ClassSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/ClassSpans.java
@@ -56,7 +56,8 @@
      */
     public ClassSpans (SpanQuery operand, LeafReaderContext context,
                        Bits acceptDocs, Map<Term, TermContext> termContexts,
-                       byte number) throws IOException {
+                       byte number)
+            throws IOException {
         spans = operand.getSpans(context, acceptDocs, termContexts);
 
         // The number of the class
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/DistanceExclusionSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/DistanceExclusionSpans.java
index f6cd732..b456035 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/DistanceExclusionSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/DistanceExclusionSpans.java
@@ -17,7 +17,7 @@
  * distance.
  * 
  * @author margaretha
- * */
+ */
 public class DistanceExclusionSpans extends DistanceSpans {
 
     private int minDistance, maxDistance;
@@ -105,7 +105,7 @@
      * @return distance the difference between the positions of a
      *         firstspan and
      *         a secondspan.
-     * */
+     */
     private int calculateActualDistance () {
         // right secondSpan
         if (firstSpans.end() <= secondSpans.start())
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/DistanceSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/DistanceSpans.java
index 7bc9136..286f91c 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/DistanceSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/DistanceSpans.java
@@ -29,7 +29,7 @@
  * @see MultipleDistanceSpans
  * 
  * @author margaretha
- * */
+ */
 public abstract class DistanceSpans extends SimpleSpans {
 
     protected CandidateSpan matchFirstSpan, matchSecondSpan;
@@ -88,7 +88,7 @@
      * 
      * @return <code>true</code> if a span match is available,
      *         <code>false</code> otherwise.
-     * */
+     */
     protected abstract boolean advance () throws IOException;
 
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/ElementDistanceExclusionSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/ElementDistanceExclusionSpans.java
index 78c0e76..1c5ebdc 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/ElementDistanceExclusionSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/ElementDistanceExclusionSpans.java
@@ -30,7 +30,7 @@
  * Note: The element distance unit does not overlap to each other.
  * 
  * @author margaretha
- * */
+ */
 public class ElementDistanceExclusionSpans extends DistanceSpans {
 
     private Spans elements;
@@ -154,8 +154,8 @@
 
         if (candidateList.isEmpty()) {
             if (isFirstSpanInElement()) {
-                setMatchProperties(new CandidateSpan(firstSpans,
-                        elementPosition));
+                setMatchProperties(
+                        new CandidateSpan(firstSpans, elementPosition));
                 hasMoreSpans = firstSpans.next();
                 return true;
             }
@@ -273,16 +273,16 @@
             if (hasMoreSpans && firstSpans.start() < secondSpans.start()
                     && firstSpans.doc() == currentDocNum) {
                 if (advanceElementTo(firstSpans)) {
-                    targetList.add(new CandidateSpan(firstSpans,
-                            elementPosition));
+                    targetList.add(
+                            new CandidateSpan(firstSpans, elementPosition));
                 }
                 hasMoreSpans = firstSpans.next();
                 continue;
             }
             // collects only second spans occurring inside an element
             if (advanceElementTo(secondSpans)) {
-                candidateList.add(new CandidateSpan(secondSpans,
-                        elementPosition));
+                candidateList
+                        .add(new CandidateSpan(secondSpans, elementPosition));
             }
             hasMoreSecondSpans = secondSpans.next();
         }
@@ -300,8 +300,8 @@
         while (hasMoreSecondSpans && secondSpans.doc() == firstSpans.doc()
                 && secondSpans.start() < firstSpans.end()) {
             if (advanceElementTo(secondSpans)) {
-                candidateList.add(new CandidateSpan(secondSpans,
-                        elementPosition));
+                candidateList
+                        .add(new CandidateSpan(secondSpans, elementPosition));
                 filterCandidateList(elementPosition);
             }
             hasMoreSecondSpans = secondSpans.next();
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/ElementDistanceSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/ElementDistanceSpans.java
index 5f3ded5..dd53ac5 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/ElementDistanceSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/ElementDistanceSpans.java
@@ -24,7 +24,7 @@
  * Note: elements cannot overlap with each other.
  * 
  * @author margaretha
- * */
+ */
 public class ElementDistanceSpans extends OrderedDistanceSpans {
 
     private Spans elements;
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/ExpandedExclusionSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/ExpandedExclusionSpans.java
index 4d64921..d747149 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/ExpandedExclusionSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/ExpandedExclusionSpans.java
@@ -37,7 +37,7 @@
  * grouping them altogether.
  * 
  * @author margaretha
- * */
+ */
 public class ExpandedExclusionSpans extends SimpleSpans {
 
     private int min, max;
@@ -68,10 +68,9 @@
         super(spanExpansionQuery, context, acceptDocs, termContexts);
 
         if (spanExpansionQuery.getSecondClause() == null) {
-            throw new IllegalArgumentException(
-                    "The SpanExpansionQuery "
-                            + "is not valid. The spanquery to exclude (notClause) cannot "
-                            + "be null.");
+            throw new IllegalArgumentException("The SpanExpansionQuery "
+                    + "is not valid. The spanquery to exclude (notClause) cannot "
+                    + "be null.");
         }
 
         /*
@@ -265,8 +264,8 @@
                     end = firstSpans.end();
                     //System.out.println(start+","+end);
                     cs = new CandidateSpan(start, end, firstSpans.doc(),
-                            firstSpans.cost(), createPayloads(start,
-                                    firstSpans.start()));
+                            firstSpans.cost(),
+                            createPayloads(start, firstSpans.start()));
                     candidateSpans.add(cs);
                 }
                 counter--;
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/ExpandedSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/ExpandedSpans.java
index b31abb6..129ef82 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/ExpandedSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/ExpandedSpans.java
@@ -27,7 +27,7 @@
  * grouping them altogether.
  * 
  * @author margaretha
- * */
+ */
 public class ExpandedSpans extends SimpleSpans {
 
     private int min, max;
@@ -117,8 +117,8 @@
             while (counter >= min) {
                 start = Math.max(0, firstSpans.start() - counter);
                 cs = new CandidateSpan(start, firstSpans.end(),
-                        firstSpans.doc(), firstSpans.cost(), createPayloads(
-                                start, firstSpans.start()));
+                        firstSpans.doc(), firstSpans.cost(),
+                        createPayloads(start, firstSpans.start()));
 
                 candidateSpans.add(cs);
                 counter--;
@@ -130,8 +130,8 @@
                 // TODO: How do I know if the end is already too far (over the end of the doc)? 
                 end = firstSpans.end() + counter;
                 cs = new CandidateSpan(firstSpans.start(), end,
-                        firstSpans.doc(), firstSpans.cost(), createPayloads(
-                                firstSpans.end(), end));
+                        firstSpans.doc(), firstSpans.cost(),
+                        createPayloads(firstSpans.end(), end));
                 candidateSpans.add(cs);
                 counter++;
             }
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/FocusSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/FocusSpans.java
index e566637..84e5da9 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/FocusSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/FocusSpans.java
@@ -108,9 +108,8 @@
         while (hasMoreSpans || candidates.size() > 0) {
             if (isSorted) {
 
-                if (firstSpans.isPayloadAvailable()
-                        && updateSpanPositions(cs = new CandidateSpan(
-                                firstSpans))) {
+                if (firstSpans.isPayloadAvailable() && updateSpanPositions(
+                        cs = new CandidateSpan(firstSpans))) {
                     setMatch(cs);
                     hasMoreSpans = firstSpans.next();
                     return true;
@@ -137,8 +136,8 @@
         while (hasMoreSpans && candidates.size() < windowSize
                 && firstSpans.doc() == currentDoc) {
 
-            if (firstSpans.isPayloadAvailable()
-                    && updateSpanPositions(cs = new CandidateSpan(firstSpans))) {
+            if (firstSpans.isPayloadAvailable() && updateSpanPositions(
+                    cs = new CandidateSpan(firstSpans))) {
                 if (cs.getDoc() == prevDoc && cs.getStart() < prevStart) {
                     log.warn("Span (" + cs.getStart() + ", " + cs.getEnd()
                             + ") is out of order and skipped.");
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/MultipleDistanceSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/MultipleDistanceSpans.java
index f1b7973..ce117ea 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/MultipleDistanceSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/MultipleDistanceSpans.java
@@ -31,7 +31,7 @@
  * </ol>
  * 
  * @author margaretha
- * */
+ */
 public class MultipleDistanceSpans extends DistanceSpans {
 
     private DistanceSpans x, y;
@@ -85,7 +85,7 @@
 
     /**
      * Finds the next match.
-     * */
+     */
     protected boolean advance () throws IOException {
         while (hasMoreSpans && ensureSameDoc(x, y)) {
             if (findMatch()) {
@@ -159,7 +159,8 @@
             }
         }
         else if (xf.getStart() == yf.getStart() && xf.getEnd() == yf.getEnd()
-                && xs.getStart() == ys.getStart() && xs.getEnd() == ys.getEnd()) {
+                && xs.getStart() == ys.getStart()
+                && xs.getEnd() == ys.getEnd()) {
             setMatchProperties(x, false);
             return true;
         }
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/NextSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/NextSpans.java
index 3db12a7..75dd930 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/NextSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/NextSpans.java
@@ -77,7 +77,8 @@
      */
     private boolean advance () throws IOException {
 
-        while (hasMoreSpans || !matchList.isEmpty() || !candidateList.isEmpty()) {
+        while (hasMoreSpans || !matchList.isEmpty()
+                || !candidateList.isEmpty()) {
             if (!matchList.isEmpty()) {
                 matchDocNumber = firstSpans.doc();
                 matchStartPosition = firstSpans.start();
@@ -197,8 +198,8 @@
                 payloads.addAll(cs.getPayloads());
         }
 
-        matchList.add(new CandidateSpan(start, cs.getEnd(),
-                candidateListDocNum, cost, payloads));
+        matchList.add(new CandidateSpan(start, cs.getEnd(), candidateListDocNum,
+                cost, payloads));
     }
 
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/NonPartialOverlappingSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/NonPartialOverlappingSpans.java
index 07d1526..4464d90 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/NonPartialOverlappingSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/NonPartialOverlappingSpans.java
@@ -19,7 +19,7 @@
  * their positions and do not have a partial overlap.
  * 
  * @author margaretha
- * */
+ */
 public abstract class NonPartialOverlappingSpans extends SimpleSpans {
 
     private Logger log = LoggerFactory
@@ -97,7 +97,7 @@
      * @return 0 iff match is found, -1 to advance the firstspan, 1 to
      *         advance
      *         the secondspan
-     * */
+     */
     protected abstract int findMatch ();
 
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/OrderedDistanceSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/OrderedDistanceSpans.java
index 64507ab..52dc507 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/OrderedDistanceSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/OrderedDistanceSpans.java
@@ -16,7 +16,7 @@
  * Base class for calculating a distance between two ordered spans.
  * 
  * @author margaretha
- * */
+ */
 public abstract class OrderedDistanceSpans extends DistanceSpans {
 
     protected boolean hasMoreFirstSpans;
@@ -57,7 +57,7 @@
 
     /**
      * Finds a span match in the candidate list.
-     * */
+     */
     @Override
     protected boolean advance () throws IOException {
         while (hasMoreSpans && candidateListIndex < candidateList.size()) {
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java
index 59d678e..ca467fc 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/RelationSpans.java
@@ -48,7 +48,7 @@
  * relation target is always 2 regardless of the relation direction.
  * 
  * @author margaretha
- * */
+ */
 public class RelationSpans extends RelationBaseSpans {
 
     private int currentDoc, currentPosition;
@@ -61,8 +61,8 @@
     private byte sourceClass, targetClass;
 
     public static enum PayloadTypeIdentifier {
-        TERM_TO_TERM(32), TERM_TO_ELEMENT(33), ELEMENT_TO_TERM(34), ELEMENT_TO_ELEMENT(
-                35);
+        TERM_TO_TERM(32), TERM_TO_ELEMENT(33), ELEMENT_TO_TERM(
+                34), ELEMENT_TO_ELEMENT(35);
 
         private byte value;
 
@@ -260,8 +260,8 @@
         if (direction == 0) {
             payload.add(createClassPayload(cs.getLeftStart(), cs.getLeftEnd(),
                     tempSourceNum, false));
-            payload.add(createClassPayload(cs.getRightStart(),
-                    cs.getRightEnd(), tempTargetNum, false));
+            payload.add(createClassPayload(cs.getRightStart(), cs.getRightEnd(),
+                    tempTargetNum, false));
 
             if (sourceClass > 0) {
                 payload.add(createClassPayload(cs.getLeftStart(),
@@ -274,8 +274,8 @@
 
         }
         else {
-            payload.add(createClassPayload(cs.getRightStart(),
-                    cs.getRightEnd(), tempSourceNum, false));
+            payload.add(createClassPayload(cs.getRightStart(), cs.getRightEnd(),
+                    tempSourceNum, false));
             payload.add(createClassPayload(cs.getLeftStart(), cs.getLeftEnd(),
                     tempTargetNum, false));
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/RepetitionSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/RepetitionSpans.java
index 843ccd8..cedd25a 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/RepetitionSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/RepetitionSpans.java
@@ -24,7 +24,7 @@
  * repetition depends on the min and max parameters.
  * 
  * @author margaretha
- * */
+ */
 public class RepetitionSpans extends SimpleSpans {
 
     // Logger
@@ -179,8 +179,8 @@
                 if (i == 1) {
                     try {
                         matchSpan = startSpan.clone();
-                        matchSpan.setPayloads(computeMatchPayload(
-                                adjacentSpans, 0, endIndex - 1));
+                        matchSpan.setPayloads(computeMatchPayload(adjacentSpans,
+                                0, endIndex - 1));
                         matchList.add(matchSpan);
                     }
                     catch (CloneNotSupportedException e) {
@@ -250,8 +250,8 @@
      *            the end index
      * @return
      */
-    private long computeMatchCost (List<CandidateSpan> adjacentSpans,
-            int start, int end) {
+    private long computeMatchCost (List<CandidateSpan> adjacentSpans, int start,
+            int end) {
         long matchCost = 0;
         for (int i = start; i <= end; i++) {
             matchCost += adjacentSpans.get(i).getCost();
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/SegmentSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/SegmentSpans.java
index d6b5d12..96b699f 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/SegmentSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/SegmentSpans.java
@@ -17,7 +17,7 @@
  * have exactly the same start and end positions.
  * 
  * @author margaretha
- * */
+ */
 public class SegmentSpans extends SimpleSpans {
 
     private boolean isRelation;
@@ -90,7 +90,7 @@
      * firstspan and
      * secondspan are identical.
      * 
-     * */
+     */
     protected int findMatch () {
         if (firstSpans.start() == secondSpans.start()
                 && firstSpans.end() == secondSpans.end()) {
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/SimpleSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/SimpleSpans.java
index 6918e38..7917eb5 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/SimpleSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/SimpleSpans.java
@@ -20,7 +20,7 @@
  * and basic methods.
  * 
  * @author margaretha
- * */
+ */
 public abstract class SimpleSpans extends Spans {
     private SimpleSpanQuery query;
     protected boolean isStartEnumeration;
@@ -51,7 +51,8 @@
 
     public SimpleSpans (SimpleSpanQuery simpleSpanQuery,
                         LeafReaderContext context, Bits acceptDocs,
-                        Map<Term, TermContext> termContexts) throws IOException {
+                        Map<Term, TermContext> termContexts)
+            throws IOException {
         this();
         query = simpleSpanQuery;
         collectPayloads = query.isCollectPayloads();
@@ -76,7 +77,7 @@
      * document.
      * 
      * @return true iff such a document exists.
-     * */
+     */
     protected boolean ensureSameDoc (Spans x, Spans y) throws IOException {
         while (x.doc() != y.doc()) {
             if (x.doc() < y.doc()) {
@@ -100,7 +101,7 @@
      * Find the same doc shared by element, firstspan and secondspan.
      * 
      * @return true iff such a doc is found.
-     * */
+     */
     protected boolean findSameDoc (Spans x, Spans y, Spans e)
             throws IOException {
 
@@ -148,12 +149,10 @@
 
     @Override
     public String toString () {
-        return getClass().getName()
-                + "("
-                + query.toString()
-                + ")@"
-                + (isStartEnumeration ? "START" : (hasMoreSpans ? (doc() + ":"
-                        + start() + "-" + end()) : "END"));
+        return getClass().getName() + "(" + query.toString() + ")@"
+                + (isStartEnumeration ? "START"
+                        : (hasMoreSpans ? (doc() + ":" + start() + "-" + end())
+                                : "END"));
     }
 
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/SpansWithAttribute.java b/src/main/java/de/ids_mannheim/korap/query/spans/SpansWithAttribute.java
index 30e57ef..bc80e69 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/SpansWithAttribute.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/SpansWithAttribute.java
@@ -31,7 +31,7 @@
  * constraints have to be formulated in Conjunctive Normal Form (CNF).
  * 
  * @author margaretha
- * */
+ */
 public class SpansWithAttribute extends SimpleSpans {
 
     private SimpleSpans referentSpans;
@@ -298,7 +298,7 @@
      * Advances the element or attribute spans to be in the same
      * document and
      * start position.
-     * */
+     */
     private boolean ensureSamePosition (SimpleSpans spans,
             AttributeSpans attributes) throws IOException {
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/SubSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/SubSpans.java
index 57f8362..4989957 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/SubSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/SubSpans.java
@@ -178,9 +178,10 @@
         cs.setDoc(firstSpans.doc());
 
         if (DEBUG) {
-            log.trace("Start at absolute position {} "
-                    + "and end at absolute position {}", cs.getStart(),
-                    cs.getEnd());
+            log.trace(
+                    "Start at absolute position {} "
+                            + "and end at absolute position {}",
+                    cs.getStart(), cs.getEnd());
         };
 
         return true;
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/TermSpansWithId.java b/src/main/java/de/ids_mannheim/korap/query/spans/TermSpansWithId.java
index 0135fca..a8a4b14 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/TermSpansWithId.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/TermSpansWithId.java
@@ -23,7 +23,7 @@
  * payload.
  * 
  * @author margaretha
- * */
+ */
 public class TermSpansWithId extends SimpleSpans {
 
     private TermSpans termSpans;
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/TokenDistanceSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/TokenDistanceSpans.java
index a33e219..dbdf130 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/TokenDistanceSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/TokenDistanceSpans.java
@@ -24,7 +24,7 @@
  * maximum end positions of the child spans.
  * 
  * @author margaretha
- * */
+ */
 public class TokenDistanceSpans extends OrderedDistanceSpans {
 
     /**
@@ -71,7 +71,7 @@
      * list
      * prepared for the previous second spans.
      * 
-     * */
+     */
     private void copyPossibleCandidates () {
         List<CandidateSpan> temp = new ArrayList<>();
         for (CandidateSpan cs : candidateList) {
@@ -85,7 +85,7 @@
     /**
      * Add new possible firstspan candidates for the current
      * secondspan.
-     * */
+     */
     private void addNewCandidates () throws IOException {
         while (hasMoreFirstSpans && firstSpans.doc() == candidateListDocNum
                 && firstSpans.start() < secondSpans.end()) {
@@ -101,9 +101,8 @@
     @Override
     protected boolean findMatch () throws IOException {
         CandidateSpan candidateSpan = candidateList.get(candidateListIndex);
-        if (minDistance == 0
-                &&
-                // intersection
+        if (minDistance == 0 &&
+        // intersection
                 candidateSpan.getStart() < secondSpans.end()
                 && secondSpans.start() < candidateSpan.getEnd()) {
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/UnorderedDistanceSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/UnorderedDistanceSpans.java
index 3088b9f..72876ab 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/UnorderedDistanceSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/UnorderedDistanceSpans.java
@@ -23,7 +23,7 @@
  * order.
  * 
  * @author margaretha
- * */
+ */
 public abstract class UnorderedDistanceSpans extends DistanceSpans {
 
     protected int minDistance, maxDistance;
@@ -260,7 +260,7 @@
      * to the match list.
      * 
      * @return a candidate span match
-     * */
+     */
     protected CandidateSpan createMatchCandidate (CandidateSpan target,
             CandidateSpan cs, boolean isDistanceZero) {
 
@@ -278,7 +278,8 @@
                 payloads.addAll(cs.getPayloads());
             }
         }
-        CandidateSpan match = new CandidateSpan(start, end, doc, cost, payloads);
+        CandidateSpan match = new CandidateSpan(start, end, doc, cost,
+                payloads);
         match.setChildSpan(cs);
         return match;
     }
@@ -288,7 +289,7 @@
      * Assigns the first candidate span in the match list as the
      * current span
      * match, and removes it from the matchList.
-     * */
+     */
     private void setMatchProperties () {
         CandidateSpan cs = matchList.get(0);
         matchDocNumber = cs.getDoc();
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/UnorderedElementDistanceSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/UnorderedElementDistanceSpans.java
index 0fec0af..6850ab4 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/UnorderedElementDistanceSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/UnorderedElementDistanceSpans.java
@@ -26,7 +26,7 @@
  * the spans.
  * 
  * @author margaretha
- * */
+ */
 public class UnorderedElementDistanceSpans extends UnorderedDistanceSpans {
 
     private Spans elements;
@@ -147,9 +147,8 @@
      */
     private int findElementPosition (Spans span) throws IOException {
         // Check in the element list
-        if (!elementList.isEmpty()
-                && span.end() <= elementList.get(elementList.size() - 1)
-                        .getEnd()) {
+        if (!elementList.isEmpty() && span.end() <= elementList
+                .get(elementList.size() - 1).getEnd()) {
 
             for (CandidateSpan e : elementList)
                 if (e.getEnd() >= span.end() && e.getStart() <= span.start()) {
@@ -223,18 +222,20 @@
      * @return <code>true</code> if the target and candidate spans are
      *         within
      *         the maximum distance, <code>false</code> otherwise.
-     * */
+     */
     protected boolean isWithinMaxDistance (CandidateSpan target,
             CandidateSpan candidate) {
         int candidatePos = candidate.getPosition();
         int targetPos = target.getPosition();
 
         // left candidate
-        if (candidatePos < targetPos && candidatePos + maxDistance < targetPos) {
+        if (candidatePos < targetPos
+                && candidatePos + maxDistance < targetPos) {
             return false;
         }
         // right candidate
-        if (candidatePos > targetPos && targetPos + maxDistance < candidatePos) {
+        if (candidatePos > targetPos
+                && targetPos + maxDistance < candidatePos) {
             return false;
         }
         return true;
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/UnorderedTokenDistanceSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/UnorderedTokenDistanceSpans.java
index a8013bb..5c1350c 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/UnorderedTokenDistanceSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/UnorderedTokenDistanceSpans.java
@@ -21,7 +21,7 @@
  * distance is a token position.
  * 
  * @author margaretha
- * */
+ */
 public class UnorderedTokenDistanceSpans extends UnorderedDistanceSpans {
 
     /**
@@ -105,7 +105,8 @@
      *         within
      *         the maximum distance, <code>false</code> otherwise.
      */
-    protected boolean isWithinMaxDistance (CandidateSpan target, Spans candidate) {
+    protected boolean isWithinMaxDistance (CandidateSpan target,
+            Spans candidate) {
         // left candidate
         if (candidate.end() < target.getStart()
                 && candidate.end() + maxDistance <= target.getStart()) {
@@ -127,9 +128,8 @@
         List<CandidateSpan> matches = new ArrayList<>();
         int actualDistance;
         for (CandidateSpan cs : candidateList) {
-            if (minDistance == 0
-                    &&
-                    // intersection
+            if (minDistance == 0 &&
+            // intersection
                     target.getStart() < cs.getEnd()
                     && cs.getStart() < target.getEnd()) {
                 matches.add(createMatchCandidate(target, cs, true));
@@ -144,7 +144,8 @@
                 // right candidate
                 actualDistance = cs.getStart() - target.getEnd() + 1;
             }
-            if (minDistance <= actualDistance && actualDistance <= maxDistance) {
+            if (minDistance <= actualDistance
+                    && actualDistance <= maxDistance) {
                 matches.add(createMatchCandidate(target, cs, false));
             }
         }
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/WithinSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/WithinSpans.java
index 9234716..fe507d9 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/WithinSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/WithinSpans.java
@@ -303,7 +303,9 @@
                 // Fetch from second store?
                 else {
 
-                    /** TODO: Change this to a single embedded object! */
+                    /**
+                     * TODO: Change this to a single embedded object!
+                     */
                     this.embeddedStart = current.start;
                     this.embeddedEnd = current.end;
                     this.embeddedDoc = current.doc;
@@ -338,7 +340,8 @@
             // shift the stored spans
             if (!this.spanStore1.isEmpty()) {
                 if (DEBUG) {
-                    log.trace("Move everything from SpanStore 1 to SpanStore 2:");
+                    log.trace(
+                            "Move everything from SpanStore 1 to SpanStore 2:");
                     for (WithinSpan i : this.spanStore1) {
                         log.trace("     | {}", i.toString());
                     };
@@ -372,8 +375,8 @@
                 this.wrapDoc = this.wrapSpans.doc();
 
                 if (DEBUG)
-                    log.trace("   Forward wrap span to {}", _currentWrap()
-                            .toString());
+                    log.trace("   Forward wrap span to {}",
+                            _currentWrap().toString());
 
                 if (this.embeddedDoc != this.wrapDoc) {
                     if (DEBUG)
@@ -842,8 +845,8 @@
 
     private WithinSpan _currentWrap () {
         WithinSpan _wrap = new WithinSpan();
-        _wrap.start = this.wrapStart != -1 ? this.wrapStart : this.wrapSpans
-                .start();
+        _wrap.start = this.wrapStart != -1 ? this.wrapStart
+                : this.wrapSpans.start();
         _wrap.end = this.wrapEnd != -1 ? this.wrapEnd : this.wrapSpans.end();
         _wrap.doc = this.wrapDoc != -1 ? this.wrapDoc : this.wrapSpans.doc();
         return _wrap;
@@ -874,7 +877,7 @@
           - storeEmbedded -> store span B for later checks
           - nextSpanA     -> forward a
           - nextSpanB     -> forward b
-
+        
           These rules were automatically generated
         */
 
@@ -1174,12 +1177,10 @@
 
     @Override
     public String toString () {
-        return getClass().getName()
-                + "("
-                + query.toString()
-                + ")@"
-                + (embeddedDoc <= 0 ? "START" : (more ? (doc() + ":" + start()
-                        + "-" + end()) : "END"));
+        return getClass().getName() + "(" + query.toString() + ")@"
+                + (embeddedDoc <= 0 ? "START"
+                        : (more ? (doc() + ":" + start() + "-" + end())
+                                : "END"));
     };
 
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanAlterQueryWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanAlterQueryWrapper.java
index 8fd18cd..9b71cbf 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanAlterQueryWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanAlterQueryWrapper.java
@@ -48,8 +48,8 @@
         this.alternatives = new ArrayList<>();
         for (String term : terms) {
             this.isNull = false;
-            this.alternatives.add(new SpanSimpleQueryWrapper(new SpanTermQuery(
-                    new Term(this.field, term))));
+            this.alternatives.add(new SpanSimpleQueryWrapper(
+                    new SpanTermQuery(new Term(this.field, term))));
         };
     };
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanAttributeQueryWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanAttributeQueryWrapper.java
index 0d0fe23..d2941f9 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanAttributeQueryWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanAttributeQueryWrapper.java
@@ -8,7 +8,7 @@
 
 /**
  * @author margaretha
- * */
+ */
 public class SpanAttributeQueryWrapper extends SpanQueryWrapper {
 
     private SpanQueryWrapper subquery;
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanClassQueryWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanClassQueryWrapper.java
index 51d4ab7..c06194f 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanClassQueryWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanClassQueryWrapper.java
@@ -70,8 +70,8 @@
         if (this.subquery.isNull())
             return (SpanQuery) null;
 
-        SpanQuery sq = (SpanQuery) this.subquery
-                .retrieveNode(this.retrieveNode).toFragmentQuery();
+        SpanQuery sq = (SpanQuery) this.subquery.retrieveNode(this.retrieveNode)
+                .toFragmentQuery();
 
         if (sq == null)
             return (SpanQuery) null;
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanExpansionQueryWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanExpansionQueryWrapper.java
index 7c4cf61..f4011c2 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanExpansionQueryWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanExpansionQueryWrapper.java
@@ -8,7 +8,6 @@
 import de.ids_mannheim.korap.query.SpanExpansionQuery;
 import de.ids_mannheim.korap.util.QueryException;
 
-
 import java.util.*;
 
 /*
@@ -21,48 +20,41 @@
 public class SpanExpansionQueryWrapper extends SpanQueryWrapper {
     private SpanQueryWrapper anchor;
 
-	// < 0 	to the left of anchor span 
+    // < 0 	to the left of anchor span 
     // >= 0  to the right of anchor span
-	private int direction;
+    private int direction;
 
-	// if > 0, collect expansion offsets
-	// using this label
+    // if > 0, collect expansion offsets
+    // using this label
     private byte classNumber;
 
 
-    public SpanExpansionQueryWrapper (SpanQueryWrapper anchor,
-									  int min,
-									  int max,
-									  int direction,
-									  byte classNumber
-		) {
-		this.anchor = anchor;
-		this.isNull = false;
-		this.min = min;
-		this.max = max;
-		this.direction = direction;
-		this.classNumber = classNumber;
-		this.isExtended = true;
-		if (direction >= 0)
-			this.isExtendedToTheRight = true;
+    public SpanExpansionQueryWrapper (SpanQueryWrapper anchor, int min, int max,
+                                      int direction, byte classNumber) {
+        this.anchor = anchor;
+        this.isNull = false;
+        this.min = min;
+        this.max = max;
+        this.direction = direction;
+        this.classNumber = classNumber;
+        this.isExtended = true;
+        if (direction >= 0)
+            this.isExtendedToTheRight = true;
     };
 
-	@Override
+
+    @Override
     public boolean isNull () {
-		// Needs to be overwritten, as min and max do not indicate null value
+        // Needs to be overwritten, as min and max do not indicate null value
         return this.isNull;
     };
-	
 
-	@Override
+
+    @Override
     public SpanQuery toFragmentQuery () throws QueryException {
-		return new SpanExpansionQuery(
-			this.anchor.retrieveNode(this.retrieveNode).toFragmentQuery(),
-			this.getMin(),
-			this.getMax(),
-			this.direction,
-			this.classNumber,
-			true
-			);
+        return new SpanExpansionQuery(
+                this.anchor.retrieveNode(this.retrieveNode).toFragmentQuery(),
+                this.getMin(), this.getMax(), this.direction, this.classNumber,
+                true);
     };
 };
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanFocusQueryWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanFocusQueryWrapper.java
index 8fadb3e..89d8f65 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanFocusQueryWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanFocusQueryWrapper.java
@@ -52,8 +52,9 @@
     public SpanQuery toFragmentQuery () throws QueryException {
         if (this.subquery.isNull())
             return (SpanQuery) null;
-        return new SpanFocusQuery(this.subquery.retrieveNode(this.retrieveNode)
-                .toFragmentQuery(), this.number);
+        return new SpanFocusQuery(
+                this.subquery.retrieveNode(this.retrieveNode).toFragmentQuery(),
+                this.number);
     };
 
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanQueryWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanQueryWrapper.java
index f0221d5..c6e1355 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanQueryWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanQueryWrapper.java
@@ -95,8 +95,8 @@
         return this.isOptional;
     };
 
-	
-	public SpanQueryWrapper isOptional (boolean opt) {
+
+    public SpanQueryWrapper isOptional (boolean opt) {
         this.isOptional = opt;
         return this;
     };
@@ -219,6 +219,7 @@
         return this;
     };
 
+
     /**
      * Check, if the wrapped query can be used as an
      * anchor query in a sequence, i.e. a query that
@@ -419,10 +420,10 @@
      */
     public String toString () {
         String string = "" + (this.isNull() ? "isNull" : "notNull") + "-"
-			+ (this.isEmpty() ? "isEmpty" : "notEmpty") + "-"
-			+ (this.isOptional() ? "isOptional" : "notOptional") + "-"
-			+ (this.isExtendedToTheRight() ? "isExtendedToTheRight" : "notExtendedToTheRight");
-		;
+                + (this.isEmpty() ? "isEmpty" : "notEmpty") + "-"
+                + (this.isOptional() ? "isOptional" : "notOptional") + "-"
+                + (this.isExtendedToTheRight() ? "isExtendedToTheRight"
+                        : "notExtendedToTheRight");;
         return string;
     };
 };
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanRepetitionQueryWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanRepetitionQueryWrapper.java
index 65c4da6..808b064 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanRepetitionQueryWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanRepetitionQueryWrapper.java
@@ -101,8 +101,9 @@
                     .toFragmentQuery();
 
         // That's a fine repetition query
-        return new SpanRepetitionQuery(this.subquery.retrieveNode(
-                this.retrieveNode).toFragmentQuery(), this.min, this.max, true);
+        return new SpanRepetitionQuery(
+                this.subquery.retrieveNode(this.retrieveNode).toFragmentQuery(),
+                this.min, this.max, true);
     };
 
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSegmentQueryWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSegmentQueryWrapper.java
index 1b1929b..8623671 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSegmentQueryWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSegmentQueryWrapper.java
@@ -196,7 +196,8 @@
 
 
     public SpanQuery toFragmentQuery () throws QueryException {
-        if (this.isNull || (this.inclusive.size() + this.exclusive.size() == 0)) {
+        if (this.isNull
+                || (this.inclusive.size() + this.exclusive.size() == 0)) {
             return (SpanQuery) null;
         }
         else if (this.inclusive.size() >= 1 && this.exclusive.size() >= 1) {
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSequenceQueryWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSequenceQueryWrapper.java
index c5aac76..2a263a6 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSequenceQueryWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSequenceQueryWrapper.java
@@ -89,8 +89,8 @@
     public SpanSequenceQueryWrapper (String field, String ... terms) {
         this(field);
         for (int i = 0; i < terms.length; i++) {
-            this.segments.add(new SpanSimpleQueryWrapper(new SpanTermQuery(
-                    new Term(field, terms[i]))));
+            this.segments.add(new SpanSimpleQueryWrapper(
+                    new SpanTermQuery(new Term(field, terms[i]))));
         };
         // Query can't be null anymore
         this.isNull = false;
@@ -133,8 +133,8 @@
         if (DEBUG) {
             if (!sswq.isEmpty()) {
                 try {
-                    log.trace("New span sequence {}", sswq.toFragmentQuery()
-                            .toString());
+                    log.trace("New span sequence {}",
+                            sswq.toFragmentQuery().toString());
                 }
                 catch (QueryException qe) {
                     log.trace("Unable to serialize query {}", qe.getMessage());
@@ -392,8 +392,8 @@
             this.constraints = new ArrayList<DistanceConstraint>(1);
         if (DEBUG)
             log.trace("With contraint {}-{} (excl {})", min, max, exclusion);
-        this.constraints.add(new DistanceConstraint(min, max, this.isInOrder,
-                exclusion));
+        this.constraints.add(
+                new DistanceConstraint(min, max, this.isInOrder, exclusion));
         return this;
     };
 
@@ -476,8 +476,8 @@
             String unit, boolean exclusion) {
 
         if (DEBUG)
-            log.trace("With contraint {}-{} (unit {}, excl {})", min, max,
-                    unit, exclusion);
+            log.trace("With contraint {}-{} (unit {}, excl {})", min, max, unit,
+                    exclusion);
 
         // Word unit
         if (unit.equals("w")) {
@@ -486,15 +486,15 @@
             if (this.constraints == null)
                 this.constraints = new ArrayList<DistanceConstraint>(1);
 
-            this.constraints.add(new DistanceConstraint(min, max, isInOrder,
-                    exclusion));
+            this.constraints.add(
+                    new DistanceConstraint(min, max, isInOrder, exclusion));
 
             return this;
         };
 
         // Element unit (sentence or paragraph)
-        return this.withConstraint(min, max, new SpanElementQueryWrapper(
-                this.field, unit), exclusion);
+        return this.withConstraint(min, max,
+                new SpanElementQueryWrapper(this.field, unit), exclusion);
     };
 
 
@@ -545,9 +545,10 @@
         // Element unit (sentence or paragraph)
         // Todo: This should possibly be evaluated to a query later on!
         try {
-            this.constraints.add(new DistanceConstraint((SpanElementQuery) unit
-                    .retrieveNode(this.retrieveNode).toFragmentQuery(), min,
-                    max, isInOrder, exclusion));
+            this.constraints.add(new DistanceConstraint(
+                    (SpanElementQuery) unit.retrieveNode(this.retrieveNode)
+                            .toFragmentQuery(),
+                    min, max, isInOrder, exclusion));
         }
         catch (QueryException qe) {
             this.constraintException = qe;
@@ -741,7 +742,7 @@
             return (SpanQuery) query;
         };
 
-		// DistanceQueries with problems
+        // DistanceQueries with problems
         if (this.hasConstraints() && this.isProblematic) {
             throw new QueryException(613,
                     "Distance constraints not supported with empty, optional or negative operands");
@@ -769,8 +770,8 @@
                     if (sq == null)
                         continue;
 
-                    SpanDistanceQuery sdquery = new SpanDistanceQuery(query,
-                            sq, constraint, true);
+                    SpanDistanceQuery sdquery = new SpanDistanceQuery(query, sq,
+                            constraint, true);
                     query = (SpanQuery) sdquery;
                 };
             }
@@ -793,8 +794,8 @@
                     if (sq == null)
                         continue;
 
-                    SpanDistanceQuery sdquery = new SpanDistanceQuery(query,
-                            sq, constraint, true);
+                    SpanDistanceQuery sdquery = new SpanDistanceQuery(query, sq,
+                            constraint, true);
                     query = (SpanQuery) sdquery;
                 };
             };
@@ -828,12 +829,12 @@
       segments to extensions).
       This has to be done as long as there are problematic segments
       In the queries.
-
+    
       While there is a segment isNegative() or isOptional() or isEmpty() do
       - look for an anchor next to it
       - merge the problematic segment with the anchor
       - go on
-
+    
       - This does not work for distance constraints!
     */
     private boolean _solveProblematicSequence () {
@@ -875,8 +876,7 @@
 
                     // Insert the solution
                     try {
-                        this.segments.set(
-                                i + 1,
+                        this.segments.set(i + 1,
                                 _merge(this.segments.get(i + 1), underScrutiny,
                                         false));
                     }
@@ -906,10 +906,8 @@
 
                     // Insert the solution
                     try {
-                        this.segments.set(
-                                i - 1,
-                                _merge(this.segments.get(i - 1), underScrutiny,
-                                        true));
+                        this.segments.set(i - 1, _merge(
+                                this.segments.get(i - 1), underScrutiny, true));
                     }
                     catch (QueryException e) {
                         this.isSolved = true;
@@ -969,8 +967,8 @@
         int direction = mergeLeft ? 1 : -1;
 
         if (DEBUG)
-            log.trace("Will merge two spans to {}", mergeLeft ? "left"
-                    : "right");
+            log.trace("Will merge two spans to {}",
+                    mergeLeft ? "left" : "right");
 
         // Make empty extension to anchor
         if (problem.isEmpty()) {
@@ -980,46 +978,44 @@
                 log.trace("Problem is empty with class {}",
                         problem.getClassNumber());
 
-			// Merge extensions!
-			if (!problem.hasClass() &&
-				!anchor.hasClass() &&
-				anchor.isExtended()) {
+            // Merge extensions!
+            if (!problem.hasClass() && !anchor.hasClass()
+                    && anchor.isExtended()) {
 
-				if (DEBUG)
-					log.trace("It may be possible to extend anchor with problem");
-				
-				if (
-					// Further extend to the right ...
-					(direction >= 0 && anchor.isExtendedToTheRight) ||
+                if (DEBUG)
+                    log.trace(
+                            "It may be possible to extend anchor with problem");
 
-					// or the left
-					(direction < 0 && !anchor.isExtendedToTheRight)) {
+                if (
+                // Further extend to the right ...
+                (direction >= 0 && anchor.isExtendedToTheRight) ||
 
-					if (DEBUG)
-						log.trace("Readjust min and max");
+                // or the left
+                        (direction < 0 && !anchor.isExtendedToTheRight)) {
 
-					// Readjust the anchor
-					anchor.setMin(anchor.getMin() + problem.getMin());
-					anchor.setMax(anchor.getMax() + problem.getMax());
+                    if (DEBUG)
+                        log.trace("Readjust min and max");
 
-					/*
-					 * This is wrong - min is only relevant for extensions
-					if (anchor.getMin() > 0)
-						anchor.isOptional = false;
-					*/					
-					return anchor;
-				};
-			};
+                    // Readjust the anchor
+                    anchor.setMin(anchor.getMin() + problem.getMin());
+                    anchor.setMax(anchor.getMax() + problem.getMax());
 
-			// Can't merge extensions
-			SpanQueryWrapper sqw = new SpanExpansionQueryWrapper(
-				anchor,
-				problem.isOptional() ? 0 : problem.getMin(),
-				problem.getMax(),
-				direction,
-				problem.hasClass() ? problem.getClassNumber() : (byte) 0
-				).isExtended(true);
-				
+                    /*
+                     * This is wrong - min is only relevant for extensions
+                    if (anchor.getMin() > 0)
+                    	anchor.isOptional = false;
+                    */
+                    return anchor;
+                };
+            };
+
+            // Can't merge extensions
+            SpanQueryWrapper sqw = new SpanExpansionQueryWrapper(anchor,
+                    problem.isOptional() ? 0 : problem.getMin(),
+                    problem.getMax(), direction,
+                    problem.hasClass() ? problem.getClassNumber() : (byte) 0)
+                            .isExtended(true);
+
             // Set right extension
             if (direction >= 0)
                 sqw.isExtendedToTheRight(true);
@@ -1036,17 +1032,17 @@
                 log.trace("Problem is negative with class {}",
                         problem.getClassNumber());
 
-			// TODO: Should probably wrapped as well!
-			// A sequence of negative tokens may expand jointly!
-			query = new SpanExpansionQuery(anchor.retrieveNode(
-											   this.retrieveNode).toFragmentQuery(), problem.retrieveNode(
-												   this.retrieveNode).toFragmentQuery(), problem.getMin(),
-										   problem.getMax(), direction,
-										   problem.hasClass() ? problem.getClassNumber() : (byte) 0,
-										   true);
+            // TODO: Should probably wrapped as well!
+            // A sequence of negative tokens may expand jointly!
+            query = new SpanExpansionQuery(
+                    anchor.retrieveNode(this.retrieveNode).toFragmentQuery(),
+                    problem.retrieveNode(this.retrieveNode).toFragmentQuery(),
+                    problem.getMin(), problem.getMax(), direction,
+                    problem.hasClass() ? problem.getClassNumber() : (byte) 0,
+                    true);
 
             SpanQueryWrapper sqw = new SpanSimpleQueryWrapper(query)
-				.isExtended(true);
+                    .isExtended(true);
 
             // Set right extension
             if (direction >= 0)
@@ -1058,29 +1054,25 @@
         if (DEBUG)
             log.trace("Problem is optional");
 
-		// [base=der][][base=Baum]?
+        // [base=der][][base=Baum]?
         // [base=der][base=baum]?
 
         // [base=der]
-        SpanAlterQueryWrapper saqw = new SpanAlterQueryWrapper(
-			this.field,
-			anchor
-			);
+        SpanAlterQueryWrapper saqw = new SpanAlterQueryWrapper(this.field,
+                anchor);
 
         // [base=der]
-        SpanSequenceQueryWrapper ssqw = new SpanSequenceQueryWrapper(
-			this.field,
-			anchor
-			);
+        SpanSequenceQueryWrapper ssqw = new SpanSequenceQueryWrapper(this.field,
+                anchor);
 
         // [base=der][base=baum]
-	    if (mergeLeft) {
+        if (mergeLeft) {
             ssqw.append(problem.isOptional(false));
-		}
+        }
         // [base=baum][base=der]
         else {
             ssqw.prepend(problem.isOptional(false));
-		}
+        }
 
         saqw.or(ssqw);
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSimpleQueryWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSimpleQueryWrapper.java
index 3d9c76a..cdf4619 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSimpleQueryWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSimpleQueryWrapper.java
@@ -26,18 +26,20 @@
         this.query = query;
     };
 
-	// This is similar to a clone
-	public SpanSimpleQueryWrapper (SpanQueryWrapper query) throws QueryException {
-		this.hasClass = query.hasClass();
-		this.isOptional = query.isOptional();
-		this.isNegative = query.isNegative();
-		this.isEmpty = query.isEmpty();
-		this.isExtended = query.isExtended();
-		this.isExtendedToTheRight = query.isExtendedToTheRight();
-		this.maybeUnsorted = query.maybeUnsorted();
-		this.retrieveNode = query.retrieveNode;
-		this.query = query.toFragmentQuery();
-		this.isNull = query.isNull();
+
+    // This is similar to a clone
+    public SpanSimpleQueryWrapper (SpanQueryWrapper query)
+            throws QueryException {
+        this.hasClass = query.hasClass();
+        this.isOptional = query.isOptional();
+        this.isNegative = query.isNegative();
+        this.isEmpty = query.isEmpty();
+        this.isExtended = query.isExtended();
+        this.isExtendedToTheRight = query.isExtendedToTheRight();
+        this.maybeUnsorted = query.maybeUnsorted();
+        this.retrieveNode = query.retrieveNode;
+        this.query = query.toFragmentQuery();
+        this.isNull = query.isNull();
     };
 
 
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSubspanQueryWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSubspanQueryWrapper.java
index d311a27..7e91844 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSubspanQueryWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanSubspanQueryWrapper.java
@@ -25,7 +25,8 @@
 
 
     public SpanSubspanQueryWrapper (SpanQueryWrapper sqw, int startOffset,
-                                    int length) throws QueryException {
+                                    int length)
+            throws QueryException {
         if (length < 0) {
             throw new QueryException(
                     "SpanSubspanQuery cannot have length less than 0.");
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanWithAttributeQueryWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanWithAttributeQueryWrapper.java
index 435b3ee..266e051 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanWithAttributeQueryWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanWithAttributeQueryWrapper.java
@@ -15,7 +15,7 @@
  * No optimization using expansion
  * 
  * @author margaretha
- * */
+ */
 public class SpanWithAttributeQueryWrapper extends SpanQueryWrapper {
 
     private SpanQueryWrapper withIdQueryWrapper = null;
@@ -33,7 +33,8 @@
             return;
         }
         if (attrQuery.isNegative) {
-            throw new QueryException("The query requires a positive attribute.");
+            throw new QueryException(
+                    "The query requires a positive attribute.");
         }
         this.attrQueryWrapper = attrQuery;
         this.isSingleAttribute = true;
@@ -153,7 +154,8 @@
 
     private SpanWithAttributeQuery createSpanWithSingleAttributeQuery (
             SimpleSpanQuery withIdQuery) throws QueryException {
-        SpanAttributeQuery attrQuery = createSpanAttributeQuery(this.attrQueryWrapper);
+        SpanAttributeQuery attrQuery = createSpanAttributeQuery(
+                this.attrQueryWrapper);
         if (attrQuery != null) {
             if (withIdQuery != null) {
                 return new SpanWithAttributeQuery(withIdQuery, attrQuery, true);
diff --git a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanWithinQueryWrapper.java b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanWithinQueryWrapper.java
index dc1f449..576b1e0 100644
--- a/src/main/java/de/ids_mannheim/korap/query/wrap/SpanWithinQueryWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/query/wrap/SpanWithinQueryWrapper.java
@@ -96,9 +96,10 @@
 
         // TODO: if (wrap.isNegative())
 
-        return new SpanWithinQuery(this.element.retrieveNode(this.retrieveNode)
-                .toFragmentQuery(), this.wrap.retrieveNode(this.retrieveNode)
-                .toFragmentQuery(), this.flag);
+        return new SpanWithinQuery(
+                this.element.retrieveNode(this.retrieveNode).toFragmentQuery(),
+                this.wrap.retrieveNode(this.retrieveNode).toFragmentQuery(),
+                this.flag);
     };
 
 
diff --git a/src/main/java/de/ids_mannheim/korap/response/Match.java b/src/main/java/de/ids_mannheim/korap/response/Match.java
index 965c736..4bf7109 100644
--- a/src/main/java/de/ids_mannheim/korap/response/Match.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Match.java
@@ -602,7 +602,8 @@
     /**
      * Get identifier for a specific position.
      * 
-     * @param int Position to get identifier on.
+     * @param int
+     *            Position to get identifier on.
      */
     @JsonIgnore
     public String getPosID (int pos) {
@@ -693,8 +694,8 @@
                         && contextSpans.end() >= this.getStartPos()) {
 
                     // Set as newStart
-                    newStart = contextSpans.start() > newStart ? contextSpans
-                            .start() : newStart;
+                    newStart = contextSpans.start() > newStart
+                            ? contextSpans.start() : newStart;
 
                     if (DEBUG)
                         log.trace("NewStart is at {}", newStart);
@@ -920,7 +921,8 @@
      * This takes a clean string and the tag stack
      * to decorate the string with annotations.
      */
-    private void _processHighlightSnippet (String clean, ArrayList<int[]> stack) {
+    private void _processHighlightSnippet (String clean,
+            ArrayList<int[]> stack) {
 
         if (DEBUG)
             log.trace("--- Process Highlight snippet");
@@ -1294,15 +1296,16 @@
             if (this.context.right.isToken()) {
                 endOffset = this.endPos + this.context.right.getLength() - 1;
                 if (DEBUG)
-                    log.trace("PTO will retrieve {} (Right context)", endOffset);
+                    log.trace("PTO will retrieve {} (Right context)",
+                            endOffset);
                 pto.add(ldid, endOffset);
 
             }
 
             // The right context is defined by characters
             else {
-                endOffsetChar = (endPosChar == -1) ? -1 : endPosChar
-                        + this.context.right.getLength();
+                endOffsetChar = (endPosChar == -1) ? -1
+                        : endPosChar + this.context.right.getLength();
             };
 
             if (startOffset != -1)
@@ -1336,7 +1339,8 @@
                     endOffsetChar);
 
         // Get snippet information from the primary data
-        if (endOffsetChar > -1 && (endOffsetChar < this.getPrimaryDataLength())) {
+        if (endOffsetChar > -1
+                && (endOffsetChar < this.getPrimaryDataLength())) {
             this.tempSnippet = this.getPrimaryData(startOffsetChar,
                     endOffsetChar);
         }
@@ -1351,8 +1355,8 @@
         if (DEBUG)
             log.trace(
                     "The match entry is {}-{} ({}-{}) with absolute offsetChars {}-{}",
-                    startPosChar - startOffsetChar, endPosChar
-                            - startOffsetChar, startPosChar, endPosChar,
+                    startPosChar - startOffsetChar,
+                    endPosChar - startOffsetChar, startPosChar, endPosChar,
                     startOffsetChar, endOffsetChar);
 
         // TODO: Simplify
diff --git a/src/main/java/de/ids_mannheim/korap/response/Response.java b/src/main/java/de/ids_mannheim/korap/response/Response.java
index 5108199..3d27919 100644
--- a/src/main/java/de/ids_mannheim/korap/response/Response.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Response.java
@@ -206,8 +206,7 @@
     public Response setBenchmark (long ts1, long ts2) {
         this.benchmark = (ts2 - ts1) < 100_000_000 ?
         // Store as miliseconds
-        (((double) (ts2 - ts1) * 1e-6) + " ms")
-                :
+                (((double) (ts2 - ts1) * 1e-6) + " ms") :
                 // Store as seconds
                 (((double) (ts2 - ts1) / 1000000000.0) + " s");
         return this;
diff --git a/src/main/java/de/ids_mannheim/korap/response/Result.java b/src/main/java/de/ids_mannheim/korap/response/Result.java
index 83d08f4..0dabb24 100644
--- a/src/main/java/de/ids_mannheim/korap/response/Result.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Result.java
@@ -89,8 +89,8 @@
         this.matches = new ArrayList<>(itemsPerPage);
         this.serialQuery = query;
         this.startIndex = startIndex;
-        this.itemsPerPage = (itemsPerPage > ITEMS_PER_PAGE_MAX || itemsPerPage < 1) ? ITEMS_PER_PAGE
-                : itemsPerPage;
+        this.itemsPerPage = (itemsPerPage > ITEMS_PER_PAGE_MAX
+                || itemsPerPage < 1) ? ITEMS_PER_PAGE : itemsPerPage;
         this.context = context;
     };
 
diff --git a/src/main/java/de/ids_mannheim/korap/response/collector/MatchCollectorDB.java b/src/main/java/de/ids_mannheim/korap/response/collector/MatchCollectorDB.java
index 0c5a604..26c5c97 100644
--- a/src/main/java/de/ids_mannheim/korap/response/collector/MatchCollectorDB.java
+++ b/src/main/java/de/ids_mannheim/korap/response/collector/MatchCollectorDB.java
@@ -140,8 +140,8 @@
             };
 
             // Prepare statement based on the string
-            PreparedStatement prep = this.connection.prepareStatement(sb
-                    .toString());
+            PreparedStatement prep = this.connection
+                    .prepareStatement(sb.toString());
 
             int i = 1;
             ListIterator li = this.matchCollector.listIterator();
diff --git a/src/main/java/de/ids_mannheim/korap/response/match/HighlightCombinator.java b/src/main/java/de/ids_mannheim/korap/response/match/HighlightCombinator.java
index 8292e4a..386afff 100644
--- a/src/main/java/de/ids_mannheim/korap/response/match/HighlightCombinator.java
+++ b/src/main/java/de/ids_mannheim/korap/response/match/HighlightCombinator.java
@@ -109,9 +109,11 @@
             lastComb = this.combine.peekLast();
 
             if (DEBUG)
-                log.trace("Closing element is unbalanced - {} "
-                        + "!= {} with lastComb {}|{}|{}", eold, number,
-                        lastComb.type, lastComb.number, lastComb.characters);
+                log.trace(
+                        "Closing element is unbalanced - {} "
+                                + "!= {} with lastComb {}|{}|{}",
+                        eold, number, lastComb.type, lastComb.number,
+                        lastComb.characters);
 
             // combinator is opening and the number is not equal to the last
             // element on the balanceStack
@@ -128,8 +130,8 @@
                     log.trace("close element a) {}", eold);
 
                 // Add a closer for the old element (this has following elements)
-                this.combine.add(new HighlightCombinatorElement((byte) 2, eold,
-                        false));
+                this.combine.add(
+                        new HighlightCombinatorElement((byte) 2, eold, false));
             };
 
             // add this element number temporarily on the stack
@@ -143,8 +145,8 @@
         lastComb = this.combine.peekLast();
 
         if (DEBUG) {
-            log.trace("LastComb: " + lastComb.type + '|' + lastComb.number
-                    + '|' + lastComb.characters + " for " + number);
+            log.trace("LastComb: " + lastComb.type + '|' + lastComb.number + '|'
+                    + lastComb.characters + " for " + number);
             log.trace("Stack for checking 2: {}|{}|{}|{}", lastComb.type,
                     lastComb.number, lastComb.characters, number);
         };
diff --git a/src/main/java/de/ids_mannheim/korap/response/match/HighlightCombinatorElement.java b/src/main/java/de/ids_mannheim/korap/response/match/HighlightCombinatorElement.java
index 9762aef..ffc9638 100644
--- a/src/main/java/de/ids_mannheim/korap/response/match/HighlightCombinatorElement.java
+++ b/src/main/java/de/ids_mannheim/korap/response/match/HighlightCombinatorElement.java
@@ -33,7 +33,8 @@
     // Constructor for highlighting elements,
     // that may not be terminal, i.e. they were closed and will
     // be reopened for overlapping issues.
-    public HighlightCombinatorElement (byte type, int number, boolean terminal) {
+    public HighlightCombinatorElement (byte type, int number,
+                                       boolean terminal) {
         this.type = type;
         this.number = number;
         this.terminal = terminal;
@@ -60,16 +61,18 @@
 
             else if (this.number < -1) {
                 sb.append("<span xml:id=\"")
-                        .append(escapeHTML(match.getPosID(match
-                                .getClassID(this.number)))).append("\">");
+                        .append(escapeHTML(
+                                match.getPosID(match.getClassID(this.number))))
+                        .append("\">");
             }
 
             else if (this.number >= 256) {
                 sb.append("<span ");
                 if (this.number < 2048) {
                     sb.append("title=\"")
-                            .append(escapeHTML(match
-                                    .getAnnotationID(this.number))).append('"');
+                            .append(escapeHTML(
+                                    match.getAnnotationID(this.number)))
+                            .append('"');
                 }
                 else {
                     Relation rel = match.getRelationID(this.number);
diff --git a/src/main/java/de/ids_mannheim/korap/server/Resource.java b/src/main/java/de/ids_mannheim/korap/server/Resource.java
index e4b94ff..26d9c2c 100644
--- a/src/main/java/de/ids_mannheim/korap/server/Resource.java
+++ b/src/main/java/de/ids_mannheim/korap/server/Resource.java
@@ -292,8 +292,8 @@
 
         // Get the database
         try {
-            final MatchCollectorDB mc = new MatchCollectorDB(1000, "Res_"
-                    + resultID);
+            final MatchCollectorDB mc = new MatchCollectorDB(1000,
+                    "Res_" + resultID);
             final ComboPooledDataSource pool = Node.getDBPool();
             mc.setDBPool("mysql", pool, pool.getConnection());
 
@@ -348,7 +348,8 @@
     @GET
     @Path("/match/{matchID}")
     @Produces(MediaType.APPLICATION_JSON)
-    public String match (@PathParam("matchID") String id, @Context UriInfo uri) {
+    public String match (@PathParam("matchID") String id,
+            @Context UriInfo uri) {
 
         Response kresp = _initResponse();
         if (kresp.hasErrors())
@@ -361,7 +362,8 @@
         // Get query parameters
         MultivaluedMap<String, String> qp = uri.getQueryParameters();
 
-        boolean includeSpans = false, includeHighlights = true, extendToSentence = false, info = false;
+        boolean includeSpans = false, includeHighlights = true,
+                extendToSentence = false, info = false;
 
         // Optional query parameter "info" for more information on the match
         if (!_isNull(qp.getFirst("info")))
@@ -387,8 +389,9 @@
 
         try {
             // Get match info
-            return index.getMatchInfo(id, "tokens", info, foundries, layers,
-                    includeSpans, includeHighlights, extendToSentence)
+            return index
+                    .getMatchInfo(id, "tokens", info, foundries, layers,
+                            includeSpans, includeHighlights, extendToSentence)
                     .toJsonString();
         }
 
@@ -407,9 +410,9 @@
       POST /peek
       POST /?text_id=...
       POST /:text_id/
-
+    
       PUT /:text_id
-
+    
       DELETE /:text_id
       DELETE /:corpus_sigle
       DELETE /:corpus_sigle/:doc_sigle
diff --git a/src/main/java/de/ids_mannheim/korap/util/KrillString.java b/src/main/java/de/ids_mannheim/korap/util/KrillString.java
index d3da39d..3e0095e 100644
--- a/src/main/java/de/ids_mannheim/korap/util/KrillString.java
+++ b/src/main/java/de/ids_mannheim/korap/util/KrillString.java
@@ -28,7 +28,7 @@
      */
     public static String StringfromFile (String path, Charset encoding)
             throws IOException {
-        path = URLDecoder.decode(path,"UTF-8");
+        path = URLDecoder.decode(path, "UTF-8");
         path = path.replaceFirst("^/(.:/)", "$1");
         Path p = Paths.get(path);
         byte[] encoded = Files.readAllBytes(p);
diff --git a/src/test/java/de/ids_mannheim/korap/Test.java b/src/test/java/de/ids_mannheim/korap/Test.java
index 9f33803..1866549 100644
--- a/src/test/java/de/ids_mannheim/korap/Test.java
+++ b/src/test/java/de/ids_mannheim/korap/Test.java
@@ -43,7 +43,8 @@
 
         // Integer fields
         for (String s : strInt) {
-            doc.add(new IntField(s, Integer.parseInt(m.get(s)), Field.Store.YES));
+            doc.add(new IntField(s, Integer.parseInt(m.get(s)),
+                    Field.Store.YES));
         };
 
         FieldType textFieldWithTermVectors = new FieldType(
diff --git a/src/test/java/de/ids_mannheim/korap/TestSimple.java b/src/test/java/de/ids_mannheim/korap/TestSimple.java
index 6451ae4..7f4f8a1 100644
--- a/src/test/java/de/ids_mannheim/korap/TestSimple.java
+++ b/src/test/java/de/ids_mannheim/korap/TestSimple.java
@@ -109,7 +109,7 @@
 
     // Get string
     public static String getJsonString (String path) {
-        
+
         StringBuilder contentBuilder = new StringBuilder();
         try {
             path = URLDecoder.decode(path, "UTF-8");
diff --git a/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSamples.java b/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSamples.java
index 535b1ce..b748a12 100644
--- a/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSamples.java
+++ b/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSamples.java
@@ -38,8 +38,7 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
diff --git a/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSpans.java b/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSpans.java
index 26874c4..eae43b1 100644
--- a/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSpans.java
+++ b/src/test/java/de/ids_mannheim/korap/benchmark/TestBenchmarkSpans.java
@@ -29,21 +29,21 @@
     @Test
     public void checkBenchmark1 () throws IOException {
         Properties prop = new Properties();
-        InputStream fr = new FileInputStream(getClass().getResource(
-                "/krill.properties").getFile());
+        InputStream fr = new FileInputStream(
+                getClass().getResource("/krill.properties").getFile());
         prop.load(fr);
 
         // Get the real index
-        KrillIndex ki = new KrillIndex(new MMapDirectory(Paths.get(prop
-                .getProperty("krill.indexDir"))));
+        KrillIndex ki = new KrillIndex(new MMapDirectory(
+                Paths.get(prop.getProperty("krill.indexDir"))));
 
         // Create a container for virtual collections:
         KrillCollection kc = new KrillCollection(ki);
 
         long t1 = 0, t2 = 0;
         /// cosmas20.json!!!
-        String json = getString(getClass().getResource(
-                "/queries/benchmark1.jsonld").getFile());
+        String json = getString(
+                getClass().getResource("/queries/benchmark1.jsonld").getFile());
 
         int rounds = 100;
 
@@ -83,21 +83,21 @@
     @Test
     public void checkBenchmark2JSON () throws IOException {
         Properties prop = new Properties();
-        InputStream fr = new FileInputStream(getClass().getResource(
-                "/krill.properties").getFile());
+        InputStream fr = new FileInputStream(
+                getClass().getResource("/krill.properties").getFile());
         prop.load(fr);
 
         // Get the real index
-        KrillIndex ki = new KrillIndex(new MMapDirectory(Paths.get(prop
-                .getProperty("krill.indexDir"))));
+        KrillIndex ki = new KrillIndex(new MMapDirectory(
+                Paths.get(prop.getProperty("krill.indexDir"))));
 
         // Create a container for virtual collections:
         KrillCollection kc = new KrillCollection(ki);
 
         long t1 = 0, t2 = 0;
         /// cosmas20.json!!!
-        String json = getString(getClass().getResource(
-                "/queries/benchmark2.jsonld").getFile());
+        String json = getString(
+                getClass().getResource("/queries/benchmark2.jsonld").getFile());
 
         int rounds = 10000;
 
@@ -129,21 +129,21 @@
     @Test
     public void checkBenchmarkSentences () throws IOException {
         Properties prop = new Properties();
-        InputStream fr = new FileInputStream(getClass().getResource(
-                "/krill.properties").getFile());
+        InputStream fr = new FileInputStream(
+                getClass().getResource("/krill.properties").getFile());
         prop.load(fr);
 
         // Get the real index
-        KrillIndex ki = new KrillIndex(new MMapDirectory(Paths.get(prop
-                .getProperty("krill.indexDir"))));
+        KrillIndex ki = new KrillIndex(new MMapDirectory(
+                Paths.get(prop.getProperty("krill.indexDir"))));
 
         // Create a container for virtual collections:
         KrillCollection kc = new KrillCollection(ki);
 
         long t1 = 0, t2 = 0;
         /// cosmas20.json!!!
-        String json = getString(getClass().getResource(
-                "/queries/benchmark4.jsonld").getFile());
+        String json = getString(
+                getClass().getResource("/queries/benchmark4.jsonld").getFile());
 
         int rounds = 10;
 
@@ -175,21 +175,21 @@
         // [orth=Der]{1:[orth=Mann]{2:[orth=und]}}
 
         Properties prop = new Properties();
-        InputStream fr = new FileInputStream(getClass().getResource(
-                "/krill.properties").getFile());
+        InputStream fr = new FileInputStream(
+                getClass().getResource("/krill.properties").getFile());
         prop.load(fr);
 
         // Get the real index
-        KrillIndex ki = new KrillIndex(new MMapDirectory(Paths.get(prop
-                .getProperty("krill.indexDir"))));
+        KrillIndex ki = new KrillIndex(new MMapDirectory(
+                Paths.get(prop.getProperty("krill.indexDir"))));
 
         // Create a container for virtual collections:
         KrillCollection kc = new KrillCollection(ki);
 
         long t1 = 0, t2 = 0;
         // Without classes
-        String json = getString(getClass().getResource(
-                "/queries/benchmark5-ohne.jsonld").getFile());
+        String json = getString(getClass()
+                .getResource("/queries/benchmark5-ohne.jsonld").getFile());
 
         int rounds = 2000;
 
@@ -208,8 +208,8 @@
         t1 = 0;
         t2 = 0;
         // With classes
-        json = getString(getClass().getResource("/queries/benchmark5.jsonld")
-                .getFile());
+        json = getString(
+                getClass().getResource("/queries/benchmark5.jsonld").getFile());
 
         t1 = System.nanoTime();
         for (int i = 1; i <= rounds; i++) {
@@ -224,8 +224,8 @@
         t1 = 0;
         t2 = 0;
         // With submatch
-        json = getString(getClass().getResource(
-                "/queries/benchmark5-submatch.jsonld").getFile());
+        json = getString(getClass()
+                .getResource("/queries/benchmark5-submatch.jsonld").getFile());
 
         t1 = System.nanoTime();
         for (int i = 1; i <= rounds; i++) {
@@ -295,9 +295,8 @@
 
             // Indexing test files
             for (String d : docs) {
-                FieldDocument fd = ki.addDoc(
-                        getClass().getResourceAsStream(
-                                "/wiki/" + d + ".json.gz"), true);
+                FieldDocument fd = ki.addDoc(getClass()
+                        .getResourceAsStream("/wiki/" + d + ".json.gz"), true);
             };
             ki.commit();
         };
@@ -321,21 +320,21 @@
     @Test
     public void checkBenchmark3 () throws IOException {
         Properties prop = new Properties();
-        InputStream fr = new FileInputStream(getClass().getResource(
-                "/krill.properties").getFile());
+        InputStream fr = new FileInputStream(
+                getClass().getResource("/krill.properties").getFile());
         prop.load(fr);
 
         // Get the real index
-        KrillIndex ki = new KrillIndex(new MMapDirectory(Paths.get(prop
-                .getProperty("krill.indexDir"))));
+        KrillIndex ki = new KrillIndex(new MMapDirectory(
+                Paths.get(prop.getProperty("krill.indexDir"))));
 
         // Create a container for virtual collections:
         KrillCollection kc = new KrillCollection(ki);
 
         long t1 = 0, t2 = 0;
         /// cosmas20.json!!!
-        String json = getString(getClass().getResource(
-                "/queries/benchmark3.jsonld").getFile());
+        String json = getString(
+                getClass().getResource("/queries/benchmark3.jsonld").getFile());
 
         int rounds = 500;
 
diff --git a/src/test/java/de/ids_mannheim/korap/collection/TestCollectionBuilder.java b/src/test/java/de/ids_mannheim/korap/collection/TestCollectionBuilder.java
index 27a3dd7..4207e6c 100644
--- a/src/test/java/de/ids_mannheim/korap/collection/TestCollectionBuilder.java
+++ b/src/test/java/de/ids_mannheim/korap/collection/TestCollectionBuilder.java
@@ -88,14 +88,14 @@
     @Test
     public void builderTill () throws IOException {
         CollectionBuilder kc = new CollectionBuilder();
-        assertEquals("pubDate:[0 TO 20059999]", kc.till("pubDate", "2005")
-                .toString());
+        assertEquals("pubDate:[0 TO 20059999]",
+                kc.till("pubDate", "2005").toString());
 
-        assertEquals("pubDate:[0 TO 20051299]", kc.till("pubDate", "2005-12")
-                .toString());
+        assertEquals("pubDate:[0 TO 20051299]",
+                kc.till("pubDate", "2005-12").toString());
 
-        assertEquals("pubDate:[0 TO 20051204]", kc
-                .till("pubDate", "2005-12-04").toString());
+        assertEquals("pubDate:[0 TO 20051204]",
+                kc.till("pubDate", "2005-12-04").toString());
     };
 
 
@@ -110,16 +110,15 @@
     @Test
     public void builderOrSimple () throws IOException {
         CollectionBuilder kc = new CollectionBuilder();
-        assertEquals("author:tree", kc.orGroup()
-                .with(kc.term("author", "tree")).toString());
+        assertEquals("author:tree",
+                kc.orGroup().with(kc.term("author", "tree")).toString());
     };
 
 
     @Test
     public void builderAndCombined () throws IOException {
         CollectionBuilder kc = new CollectionBuilder();
-        assertEquals(
-                "AndGroup(author:tree title:name)",
+        assertEquals("AndGroup(author:tree title:name)",
                 kc.andGroup().with(kc.term("author", "tree"))
                         .with(kc.term("title", "name")).toString());
     };
@@ -128,19 +127,16 @@
     @Test
     public void builderAndNestedSimple () throws IOException {
         CollectionBuilder kc = new CollectionBuilder();
-        assertEquals(
-                "AndGroup(author:tree title:name)",
-                kc.andGroup()
-                        .with(kc.andGroup().with(kc.term("author", "tree"))
-                                .with(kc.term("title", "name"))).toString());
+        assertEquals("AndGroup(author:tree title:name)",
+                kc.andGroup().with(kc.andGroup().with(kc.term("author", "tree"))
+                        .with(kc.term("title", "name"))).toString());
     };
 
 
     @Test
     public void builderOrCombined () throws IOException {
         CollectionBuilder kc = new CollectionBuilder();
-        assertEquals(
-                "OrGroup(author:tree title:name)",
+        assertEquals("OrGroup(author:tree title:name)",
                 kc.orGroup().with(kc.term("author", "tree"))
                         .with(kc.term("title", "name")).toString());
     };
@@ -149,23 +145,21 @@
     @Test
     public void builderOrNestedSimple () throws IOException {
         CollectionBuilder kc = new CollectionBuilder();
-        assertEquals(
-                "OrGroup(author:tree title:name)",
-                kc.orGroup()
-                        .with(kc.orGroup().with(kc.term("author", "tree"))
-                                .with(kc.term("title", "name"))).toString());
+        assertEquals("OrGroup(author:tree title:name)",
+                kc.orGroup().with(kc.orGroup().with(kc.term("author", "tree"))
+                        .with(kc.term("title", "name"))).toString());
     };
 
 
     @Test
     public void builderGroups () throws IOException {
         CollectionBuilder kc = new CollectionBuilder();
-        String g = kc
-                .orGroup()
+        String g = kc.orGroup()
                 .with(kc.orGroup().with(kc.term("author", "tree1"))
                         .with(kc.term("title", "name1")))
                 .with(kc.andGroup().with(kc.term("author", "tree2"))
-                        .with(kc.term("title", "name2"))).toString();
+                        .with(kc.term("title", "name2")))
+                .toString();
         assertEquals(
                 "OrGroup(OrGroup(author:tree1 title:name1) AndGroup(author:tree2 title:name2))",
                 g);
@@ -181,9 +175,8 @@
         assertEquals("OrGroup(author:tree1 title:name1)", kbi.toString());
         assertFalse(kbi.isNegative());
 
-        kbi = kc.andGroup()
-                .with(kc.orGroup().with(kc.term("author", "tree1"))
-                        .with(kc.term("title", "name1"))).not();
+        kbi = kc.andGroup().with(kc.orGroup().with(kc.term("author", "tree1"))
+                .with(kc.term("title", "name1"))).not();
         assertEquals("OrGroup(author:tree1 title:name1)", kbi.toString());
         assertTrue(kbi.isNegative());
     };
@@ -223,8 +216,7 @@
                 kf.and("textClass", "tree").and("textClass", "sport")
                         .toString());
         */
-        assertEquals(
-                "AndGroup(textClass:tree textClass:sport)",
+        assertEquals("AndGroup(textClass:tree textClass:sport)",
                 kf.andGroup().with(kf.term("textClass", "tree"))
                         .with(kf.term("textClass", "sport")).toString());
 
@@ -245,8 +237,7 @@
         assertEquals("+textClass:tree +textClass:sport +textClass:news", kf
                 .and("textClass", "tree", "sport", "news").toString());
         */
-        assertEquals(
-                "AndGroup(textClass:tree textClass:sport textClass:news)",
+        assertEquals("AndGroup(textClass:tree textClass:sport textClass:news)",
                 kf.andGroup().with("textClass", "tree")
                         .with("textClass", "sport").with("textClass", "news")
                         .toString());
@@ -255,9 +246,9 @@
         assertEquals("corpusID:c-1 corpusID:c-2 corpusID:c-3",
                 kf.or("corpusID", "c-1", "c-2", "c-3").toString());
         */
-        assertEquals("OrGroup(corpusID:c-1 corpusID:c-2 corpusID:c-3)", kf
-                .orGroup().with("corpusID", "c-1").with("corpusID", "c-2")
-                .with("corpusID", "c-3").toString());
+        assertEquals("OrGroup(corpusID:c-1 corpusID:c-2 corpusID:c-3)",
+                kf.orGroup().with("corpusID", "c-1").with("corpusID", "c-2")
+                        .with("corpusID", "c-3").toString());
 
     };
 
@@ -279,8 +270,8 @@
         assertEquals("+pubDate:[0 TO 20030604]", kf.till("2003-06-04")
                 .toString());
         */
-        assertEquals("pubDate:[0 TO 20030604]", kf
-                .till("pubDate", "2003-06-04").toString());
+        assertEquals("pubDate:[0 TO 20030604]",
+                kf.till("pubDate", "2003-06-04").toString());
 
 
         /*
@@ -345,40 +336,40 @@
         /*
         assertEquals("+pubDate:[0 TO 20059999]", kf.till("2005").toString());
         */
-        assertEquals("pubDate:[0 TO 20059999]", kf.till("pubDate", "2005")
-                .toString());
+        assertEquals("pubDate:[0 TO 20059999]",
+                kf.till("pubDate", "2005").toString());
 
         /*
         assertEquals("+pubDate:[0 TO 20051099]", kf.till("200510").toString());
         */
-        assertEquals("pubDate:[0 TO 20051099]", kf.till("pubDate", "200510")
-                .toString());
+        assertEquals("pubDate:[0 TO 20051099]",
+                kf.till("pubDate", "200510").toString());
 
         /*
         assertEquals("+pubDate:[0 TO 20051099]", kf.till("200510").toString());
         */
-        assertEquals("pubDate:[0 TO 20051099]", kf.till("pubDate", "200510")
-                .toString());
+        assertEquals("pubDate:[0 TO 20051099]",
+                kf.till("pubDate", "200510").toString());
 
         /*
         assertEquals("+pubDate:[0 TO 20051099]", kf.till("2005-10").toString());
         */
-        assertEquals("pubDate:[0 TO 20051099]", kf.till("pubDate", "2005-10")
-                .toString());
+        assertEquals("pubDate:[0 TO 20051099]",
+                kf.till("pubDate", "2005-10").toString());
 
         /*
         assertEquals("+pubDate:[0 TO 20051006]", kf.till("2005-1006")
                 .toString());
          */
-        assertEquals("pubDate:[0 TO 20051006]", kf.till("pubDate", "2005-1006")
-                .toString());
+        assertEquals("pubDate:[0 TO 20051006]",
+                kf.till("pubDate", "2005-1006").toString());
 
         /*
         assertEquals("+pubDate:[0 TO 20051006]", kf.till("2005-10-06")
                 .toString());
         */
-        assertEquals("pubDate:[0 TO 20051006]", kf
-                .till("pubDate", "2005-10-06").toString());
+        assertEquals("pubDate:[0 TO 20051006]",
+                kf.till("pubDate", "2005-10-06").toString());
 
         /*
         assertEquals("+pubDate:[20050000 TO 99999999]", kf.since("2005")
diff --git a/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionIndex.java b/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionIndex.java
index 27071fa..787bf3f 100644
--- a/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionIndex.java
@@ -348,8 +348,7 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
@@ -405,13 +404,11 @@
         assertEquals("Paragraphs", 48, kc.numberOf("paragraphs"));
 
         // Create a query
-        Krill ks = new Krill(new QueryBuilder("tokens").seg("opennlp/p:NN")
-                .with("tt/p:NN"));
-        ks.setCollection(kc)
-                .getMeta()
-                .setStartIndex(0)
-                .setCount((short) 20)
-                .setContext(new SearchContext(true, (short) 5, true, (short) 5));
+        Krill ks = new Krill(
+                new QueryBuilder("tokens").seg("opennlp/p:NN").with("tt/p:NN"));
+        ks.setCollection(kc).getMeta().setStartIndex(0).setCount((short) 20)
+                .setContext(
+                        new SearchContext(true, (short) 5, true, (short) 5));
 
         Result kr = ks.apply(ki);
 
@@ -444,8 +441,7 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
             ki.commit();
         };
@@ -497,13 +493,11 @@
         assertEquals("Paragraphs", 48, kc.numberOf("paragraphs"));
 
         // Create a query
-        Krill ks = new Krill(new QueryBuilder("tokens").seg("opennlp/p:NN")
-                .with("tt/p:NN"));
-        ks.setCollection(kc)
-                .getMeta()
-                .setStartIndex(0)
-                .setCount((short) 20)
-                .setContext(new SearchContext(true, (short) 5, true, (short) 5));
+        Krill ks = new Krill(
+                new QueryBuilder("tokens").seg("opennlp/p:NN").with("tt/p:NN"));
+        ks.setCollection(kc).getMeta().setStartIndex(0).setCount((short) 20)
+                .setContext(
+                        new SearchContext(true, (short) 5, true, (short) 5));
 
         Result kr = ks.apply(ki);
         /*
@@ -558,20 +552,20 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
 
-        ki.addDoc(getClass()
-                .getResourceAsStream("/wiki/00012-fakemeta.json.gz"), true);
+        ki.addDoc(
+                getClass().getResourceAsStream("/wiki/00012-fakemeta.json.gz"),
+                true);
 
         ki.commit();
 
         /*
         CollectionBuilderLegacy kf = new CollectionBuilderLegacy();
-
+        
         // Create Virtual collections:
         KrillCollectionLegacy kc = new KrillCollectionLegacy(ki);
         kc.filter(kf.and("textClass", "reisen").and("textClass",
@@ -590,13 +584,11 @@
 
 
         // Create a query
-        Krill ks = new Krill(new QueryBuilder("tokens").seg("opennlp/p:NN")
-                .with("tt/p:NN"));
-        ks.setCollection(kc)
-                .getMeta()
-                .setStartIndex(0)
-                .setCount((short) 20)
-                .setContext(new SearchContext(true, (short) 5, true, (short) 5));
+        Krill ks = new Krill(
+                new QueryBuilder("tokens").seg("opennlp/p:NN").with("tt/p:NN"));
+        ks.setCollection(kc).getMeta().setStartIndex(0).setCount((short) 20)
+                .setContext(
+                        new SearchContext(true, (short) 5, true, (short) 5));
 
         Result kr = ks.apply(ki);
 
@@ -658,11 +650,9 @@
 
 
         Krill ks = new Krill(sq);
-        ks.setCollection(kc)
-                .getMeta()
-                .setStartIndex(0)
-                .setCount((short) 20)
-                .setContext(new SearchContext(true, (short) 5, true, (short) 5));
+        ks.setCollection(kc).getMeta().setStartIndex(0).setCount((short) 20)
+                .setContext(
+                        new SearchContext(true, (short) 5, true, (short) 5));
         kr = ks.apply(ki);
 
         // kr = ki.search(kc, sq, 0, (short) 20, true, (short) 5, true, (short) 5);
diff --git a/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java b/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java
index 8b08bda..95f8073 100644
--- a/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java
@@ -66,8 +66,8 @@
         assertFalse(ks.hasErrors());
         assertFalse(ks.hasWarnings());
         assertFalse(ks.hasMessages());
-        assertEquals("QueryWrapperFilter(author:/Goethe/)", ks.getCollection()
-                .toString());
+        assertEquals("QueryWrapperFilter(author:/Goethe/)",
+                ks.getCollection().toString());
     };
 
 
@@ -78,8 +78,8 @@
         assertFalse(ks.hasErrors());
         assertFalse(ks.hasWarnings());
         assertFalse(ks.hasMessages());
-        assertEquals("-QueryWrapperFilter(author:/Goethe/)", ks.getCollection()
-                .toString());
+        assertEquals("-QueryWrapperFilter(author:/Goethe/)",
+                ks.getCollection().toString());
     };
 
 
@@ -112,8 +112,8 @@
         assertFalse(ks.hasErrors());
         assertFalse(ks.hasWarnings());
         assertFalse(ks.hasMessages());
-        assertEquals("QueryWrapperFilter(author:/Goe:th=e/)", ks
-                .getCollection().toString());
+        assertEquals("QueryWrapperFilter(author:/Goe:th=e/)",
+                ks.getCollection().toString());
     };
 
 
@@ -132,7 +132,8 @@
 
     @Test
     public void nocollectiontypegiven () {
-        String metaQuery = _getJSONString("multiterm_rewrite_collection.jsonld");
+        String metaQuery = _getJSONString(
+                "multiterm_rewrite_collection.jsonld");
         KrillCollection kc = new KrillCollection(metaQuery);
         assertEquals(701, kc.getError(0).getCode());
     };
@@ -154,8 +155,7 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
@@ -186,8 +186,8 @@
     // Legacy collections reflect old tests, that were adopted to the new scheme
     @Test
     public void metaQuery1Legacy () {
-        String metaQuery = getJsonString(getClass().getResource(
-                "/queries/metaquery.jsonld").getFile());
+        String metaQuery = getJsonString(
+                getClass().getResource("/queries/metaquery.jsonld").getFile());
         KrillCollection kc = new KrillCollection(metaQuery);
 
         /*
@@ -211,8 +211,8 @@
 
     @Test
     public void metaQuery2Legacy () {
-        String metaQuery = getJsonString(getClass().getResource(
-                "/queries/metaquery2.jsonld").getFile());
+        String metaQuery = getJsonString(
+                getClass().getResource("/queries/metaquery2.jsonld").getFile());
         KrillCollection kc = new KrillCollection(metaQuery);
         /*
         assertEquals(1, kc.getCount());
@@ -227,8 +227,8 @@
 
     @Test
     public void metaQuery3Legacy () {
-        String metaQuery = getJsonString(getClass().getResource(
-                "/queries/metaquery4.jsonld").getFile());
+        String metaQuery = getJsonString(
+                getClass().getResource("/queries/metaquery4.jsonld").getFile());
         KrillCollection kc = new KrillCollection(metaQuery);
         /*
         assertEquals(1, kc.getCount());
@@ -245,8 +245,8 @@
 
     @Test
     public void metaQuery7Legacy () {
-        String metaQuery = getJsonString(getClass().getResource(
-                "/queries/metaquery7.jsonld").getFile());
+        String metaQuery = getJsonString(
+                getClass().getResource("/queries/metaquery7.jsonld").getFile());
         KrillCollection kc = new KrillCollection(metaQuery);
         /*
         assertEquals(2, kc.getCount());
@@ -266,8 +266,8 @@
 
     @Test
     public void metaQuery9 () {
-        String metaQuery = getJsonString(getClass().getResource(
-                "/queries/metaquery9.jsonld").getFile());
+        String metaQuery = getJsonString(
+                getClass().getResource("/queries/metaquery9.jsonld").getFile());
         KrillCollection kc = new KrillCollection(metaQuery);
         /*
         assertEquals(1, kc.getCount());
diff --git a/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java b/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java
index 2371d3d..4785667 100644
--- a/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java
+++ b/src/test/java/de/ids_mannheim/korap/highlight/TestClass.java
@@ -30,8 +30,9 @@
     @Test
     public void queryJSONpoly1 () throws QueryException, IOException {
 
-        String jsonPath = URLDecoder.decode(getClass().getResource("/queries/poly1.json")
-                .getFile(),"UTF-8");
+        String jsonPath = URLDecoder.decode(
+                getClass().getResource("/queries/poly1.json").getFile(),
+                "UTF-8");
         String jsonQuery = readFile(jsonPath);
         SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonQuery);
 
@@ -65,8 +66,9 @@
     @Test
     public void queryJSONpoly4 () throws QueryException, IOException {
 
-        String jsonPath = URLDecoder.decode(getClass().getResource("/queries/poly4.json")
-                .getFile(),"UTF-8");
+        String jsonPath = URLDecoder.decode(
+                getClass().getResource("/queries/poly4.json").getFile(),
+                "UTF-8");
         String jsonQuery = readFile(jsonPath);
         SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonQuery);
         SpanQuery sq = sqwi.toQuery();
diff --git a/src/test/java/de/ids_mannheim/korap/highlight/TestHighlight.java b/src/test/java/de/ids_mannheim/korap/highlight/TestHighlight.java
index 43c15eb..5507a89 100644
--- a/src/test/java/de/ids_mannheim/korap/highlight/TestHighlight.java
+++ b/src/test/java/de/ids_mannheim/korap/highlight/TestHighlight.java
@@ -43,8 +43,8 @@
 
 
         QueryBuilder kq = new QueryBuilder("tokens");
-        Result kr = ki.search((SpanQuery) kq.seq(kq._(1, kq.seg("s:b")))
-                .toQuery());
+        Result kr = ki
+                .search((SpanQuery) kq.seq(kq._(1, kq.seg("s:b"))).toQuery());
         Match km = kr.getMatch(0);
         assertEquals(km.getStartPos(), 1);
         assertEquals(km.getEndPos(), 2);
@@ -83,10 +83,14 @@
                 km.getSnippetHTML());
 
 
-        kr = ki.search((SpanQuery) kq._(
-                3,
-                kq.seq(kq._(1, kq.seq(kq.seg("s:a")).append(kq.seg("s:b"))))
-                        .append(kq._(2, kq.seg("s:c")))).toQuery());
+        kr = ki.search(
+                (SpanQuery) kq._(
+                        3, kq
+                                .seq(kq._(1,
+                                        kq.seq(kq.seg("s:a"))
+                                                .append(kq.seg("s:b"))))
+                                .append(kq._(2, kq.seg("s:c"))))
+                        .toQuery());
         km = kr.getMatch(0);
         assertEquals(km.getStartPos(), 0);
         assertEquals(km.getEndPos(), 3);
@@ -147,9 +151,9 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
         fd.addString("UID", "1");
-        fd.addTV("base", "abab", "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]"
-                + "[(1-2)s:b|i:b|_1#1-2]" + "[(2-3)s:a|i:c|_2#2-3]"
-                + "[(3-4)s:b|i:a|_3#3-4]");
+        fd.addTV("base", "abab",
+                "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]" + "[(1-2)s:b|i:b|_1#1-2]"
+                        + "[(2-3)s:a|i:c|_2#2-3]" + "[(3-4)s:b|i:a|_3#3-4]");
         ki.addDoc(fd);
         fd = new FieldDocument();
         fd.addString("ID", "doc-2");
@@ -163,9 +167,9 @@
         fd = new FieldDocument();
         fd.addString("ID", "doc-3");
         fd.addString("UID", "3");
-        fd.addTV("base", "abab", "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]"
-                + "[(1-2)s:b|i:b|_1#1-2]" + "[(2-3)s:a|i:c|_2#2-3]"
-                + "[(3-4)s:b|i:a|_3#3-4]");
+        fd.addTV("base", "abab",
+                "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]" + "[(1-2)s:b|i:b|_1#1-2]"
+                        + "[(2-3)s:a|i:c|_2#2-3]" + "[(3-4)s:b|i:a|_3#3-4]");
         ki.addDoc(fd);
 
         // Commit!
@@ -204,8 +208,8 @@
         assertEquals("ab[[{1:a}]]", kr.getMatch(13).getSnippetBrackets());
 
         kq = new QueryBuilder("base");
-        q = (SpanQuery) kq.or(kq._(1, kq.seg("i:a")))
-                .or(kq._(2, kq.seg("i:c"))).toQuery();
+        q = (SpanQuery) kq.or(kq._(1, kq.seg("i:a"))).or(kq._(2, kq.seg("i:c")))
+                .toQuery();
         Krill qs = new Krill(q);
         qs.getMeta().getContext().left.setToken(true).setLength((short) 1);
         qs.getMeta().getContext().right.setToken(true).setLength((short) 1);
@@ -239,8 +243,8 @@
         assertEquals("[[{1:a}]] ...", kr.getMatch(8).getSnippetBrackets());
         assertEquals("... [[{2:a}]]", kr.getMatch(9).getSnippetBrackets());
 
-        q = (SpanQuery) kq._(3,
-                kq.or(kq._(1, kq.seg("i:a"))).or(kq._(2, kq.seg("i:c"))))
+        q = (SpanQuery) kq
+                ._(3, kq.or(kq._(1, kq.seg("i:a"))).or(kq._(2, kq.seg("i:c"))))
                 .toQuery();
         qs = new Krill(q);
         qs.getMeta().getContext().left.setToken(true).setLength((short) 0);
@@ -249,14 +253,14 @@
         assertEquals((long) 10, kr.getTotalResults());
 
         assertEquals("[[{3:{1:a}}]] ...", kr.getMatch(0).getSnippetBrackets());
-        assertEquals("... [[{3:{2:a}}]] ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("... [[{3:{2:a}}]] ...",
+                kr.getMatch(1).getSnippetBrackets());
         assertEquals("... [[{3:{1:b}}]]", kr.getMatch(2).getSnippetBrackets());
         assertEquals("[[{3:{1:a}}]] ...", kr.getMatch(3).getSnippetBrackets());
         assertEquals("... [[{3:{2:a}}]]", kr.getMatch(4).getSnippetBrackets());
         assertEquals("[[{3:{1:a}}]] ...", kr.getMatch(5).getSnippetBrackets());
-        assertEquals("... [[{3:{2:a}}]] ...", kr.getMatch(6)
-                .getSnippetBrackets());
+        assertEquals("... [[{3:{2:a}}]] ...",
+                kr.getMatch(6).getSnippetBrackets());
         assertEquals("... [[{3:{1:b}}]]", kr.getMatch(7).getSnippetBrackets());
         assertEquals("[[{3:{1:a}}]] ...", kr.getMatch(8).getSnippetBrackets());
         assertEquals("... [[{3:{2:a}}]]", kr.getMatch(9).getSnippetBrackets());
@@ -270,30 +274,29 @@
         KrillIndex ki = new KrillIndex();
         // Indexing test files
         for (String i : new String[] { "00001", "00002" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
 
         // 15
-        String json = getJsonString(getClass().getResource(
-                "/queries/bugs/greater_highlights_15.jsonld").getFile());
+        String json = getJsonString(getClass()
+                .getResource("/queries/bugs/greater_highlights_15.jsonld")
+                .getFile());
 
         Krill ks = new Krill(json);
         Result kr = ks.apply(ki);
         assertEquals(kr.getSerialQuery(), "{15: tokens:s:Alphabet}");
         assertEquals(kr.getTotalResults(), 7);
         assertEquals(kr.getStartIndex(), 0);
-        assertEquals(
-                kr.getMatch(0).getSnippetBrackets(),
+        assertEquals(kr.getMatch(0).getSnippetBrackets(),
                 "... 2. Herkunft Die aus dem proto-semitischen [[{15:Alphabet}]] stammende Urform des Buchstaben ist wahrscheinlich ...");
-        assertEquals(
-                kr.getMatch(0).getSnippetHTML(),
+        assertEquals(kr.getMatch(0).getSnippetHTML(),
                 "<span class=\"context-left\"><span class=\"more\"></span>2. Herkunft Die aus dem proto-semitischen </span><span class=\"match\"><mark><mark class=\"class-15 level-0\">Alphabet</mark></mark></span><span class=\"context-right\"> stammende Urform des Buchstaben ist wahrscheinlich<span class=\"more\"></span></span>");
 
-        json = getJsonString(getClass().getResource(
-                "/queries/bugs/greater_highlights_16.jsonld").getFile());
+        json = getJsonString(getClass()
+                .getResource("/queries/bugs/greater_highlights_16.jsonld")
+                .getFile());
 
         // 16
         ks = new Krill(json);
@@ -301,54 +304,51 @@
         assertEquals(kr.getSerialQuery(), "{16: tokens:s:Alphabet}");
         assertEquals(kr.getTotalResults(), 7);
         assertEquals(kr.getStartIndex(), 0);
-        assertEquals(
-                kr.getMatch(0).getSnippetBrackets(),
+        assertEquals(kr.getMatch(0).getSnippetBrackets(),
                 "... 2. Herkunft Die aus dem proto-semitischen [[{16:Alphabet}]] stammende Urform des Buchstaben ist wahrscheinlich ...");
-        assertEquals(
-                kr.getMatch(0).getSnippetHTML(),
+        assertEquals(kr.getMatch(0).getSnippetHTML(),
                 "<span class=\"context-left\"><span class=\"more\"></span>2. Herkunft Die aus dem proto-semitischen </span><span class=\"match\"><mark><mark class=\"class-16 level-0\">Alphabet</mark></mark></span><span class=\"context-right\"> stammende Urform des Buchstaben ist wahrscheinlich<span class=\"more\"></span></span>");
 
         // 127
-        json = getJsonString(getClass().getResource(
-                "/queries/bugs/greater_highlights_127.jsonld").getFile());
+        json = getJsonString(getClass()
+                .getResource("/queries/bugs/greater_highlights_127.jsonld")
+                .getFile());
 
         ks = new Krill(json);
         kr = ks.apply(ki);
         assertEquals(kr.getSerialQuery(), "{127: tokens:s:Alphabet}");
         assertEquals(kr.getTotalResults(), 7);
         assertEquals(kr.getStartIndex(), 0);
-        assertEquals(
-                kr.getMatch(0).getSnippetBrackets(),
+        assertEquals(kr.getMatch(0).getSnippetBrackets(),
                 "... 2. Herkunft Die aus dem proto-semitischen [[{127:Alphabet}]] stammende Urform des Buchstaben ist wahrscheinlich ...");
-        assertEquals(
-                kr.getMatch(0).getSnippetHTML(),
+        assertEquals(kr.getMatch(0).getSnippetHTML(),
                 "<span class=\"context-left\"><span class=\"more\"></span>2. Herkunft Die aus dem proto-semitischen </span><span class=\"match\"><mark><mark class=\"class-127 level-0\">Alphabet</mark></mark></span><span class=\"context-right\"> stammende Urform des Buchstaben ist wahrscheinlich<span class=\"more\"></span></span>");
 
         // 255
-        json = getJsonString(getClass().getResource(
-                "/queries/bugs/greater_highlights_255.jsonld").getFile());
+        json = getJsonString(getClass()
+                .getResource("/queries/bugs/greater_highlights_255.jsonld")
+                .getFile());
 
         ks = new Krill(json);
         kr = ks.apply(ki);
         assertEquals(kr.getSerialQuery(), "{255: tokens:s:Alphabet}");
         assertEquals(kr.getTotalResults(), 7);
         assertEquals(kr.getStartIndex(), 0);
-        assertEquals(
-                kr.getMatch(0).getSnippetBrackets(),
+        assertEquals(kr.getMatch(0).getSnippetBrackets(),
                 "... 2. Herkunft Die aus dem proto-semitischen [[Alphabet]] stammende Urform des Buchstaben ist wahrscheinlich ...");
-        assertEquals(
-                kr.getMatch(0).getSnippetHTML(),
+        assertEquals(kr.getMatch(0).getSnippetHTML(),
                 "<span class=\"context-left\"><span class=\"more\"></span>2. Herkunft Die aus dem proto-semitischen </span><span class=\"match\"><mark>Alphabet</mark></span><span class=\"context-right\"> stammende Urform des Buchstaben ist wahrscheinlich<span class=\"more\"></span></span>");
 
         // 300
-        json = getJsonString(getClass().getResource(
-                "/queries/bugs/greater_highlights_300.jsonld").getFile());
+        json = getJsonString(getClass()
+                .getResource("/queries/bugs/greater_highlights_300.jsonld")
+                .getFile());
 
         ks = new Krill(json);
         kr = ks.apply(ki);
         assertEquals(709, kr.getError(0).getCode());
-        assertEquals("Valid class numbers exceeded", kr.getError(0)
-                .getMessage());
+        assertEquals("Valid class numbers exceeded",
+                kr.getError(0).getMessage());
 
         assertEquals(kr.getError(0).getMessage(),
                 "Valid class numbers exceeded");
@@ -365,9 +365,7 @@
 
         // Make this clean for HTML and Brackets!
 
-        fd.addTV(
-                "base",
-                "Mit \"Mann\" & {Ma\\us}",
+        fd.addTV("base", "Mit \"Mann\" & {Ma\\us}",
                 "[(0-3)s:Mit|i:mit|_0#0-3|-:t$<i>4|<>:base/t:t$<b>64<i>0<i>20<i>4<b>0]"
                         + "[(4-10)s:\"Mann\"|i:\"mann\"|base/l:\"Mann\"|_1#4-10]"
                         + "[(11-12)s:&|i:&|base/l:&|_2#11-12]"
@@ -385,8 +383,8 @@
 
         Result kr = ki.search(qs);
         assertEquals((long) 1, kr.getTotalResults());
-        assertEquals("[[Mit \"Mann\" & \\{Ma\\\\us\\}]]", kr.getMatch(0)
-                .getSnippetBrackets());
+        assertEquals("[[Mit \"Mann\" & \\{Ma\\\\us\\}]]",
+                kr.getMatch(0).getSnippetBrackets());
         assertEquals(
                 "<span class=\"context-left\"></span><span class=\"match\"><mark>Mit &quot;Mann&quot; &amp; {Ma\\us}</mark></span><span class=\"context-right\"></span>",
                 kr.getMatch(0).getSnippetHTML());
@@ -395,12 +393,14 @@
         Match km = ki.getMatchInfo("match-c1/d1/1-p0-4", "base", true,
                 (ArrayList) null, (ArrayList) null, true, true, false);
         assertEquals(0, km.getStartPos());
-        assertEquals("<span class=\"context-left\"></span>"
-                + "<span class=\"match\"><mark><span title=\"base/t:t\">"
-                + "Mit " + "<span title=\"base/l:&quot;Mann&quot;\">"
-                + "&quot;Mann&quot;" + "</span>" + " "
-                + "<span title=\"base/l:&amp;\">&amp;</span>" + " "
-                + "{Ma\\us}" + "</span>" + "</mark></span>"
-                + "<span class=\"context-right\"></span>", km.getSnippetHTML());
+        assertEquals(
+                "<span class=\"context-left\"></span>"
+                        + "<span class=\"match\"><mark><span title=\"base/t:t\">"
+                        + "Mit " + "<span title=\"base/l:&quot;Mann&quot;\">"
+                        + "&quot;Mann&quot;" + "</span>" + " "
+                        + "<span title=\"base/l:&amp;\">&amp;</span>" + " "
+                        + "{Ma\\us}" + "</span>" + "</mark></span>"
+                        + "<span class=\"context-right\"></span>",
+                km.getSnippetHTML());
     };
 };
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestAttributeIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestAttributeIndex.java
index 8d7027f..3fc9ea5 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestAttributeIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestAttributeIndex.java
@@ -33,38 +33,32 @@
     private FieldDocument createFieldDoc0 () {
         fd = new FieldDocument();
         fd.addString("ID", "doc-0");
-        fd.addTV(
-                "base",
-                "bcbabd",
-                "[(0-1)s:a|_1$<i>0<i>1|"
-                        + "<>:s$<b>64<i>0<i>5<i>5<b>0<s>3|"
-                        + "<>:div$<b>64<i>0<i>2<i>2<b>0<s>2|"
-                        + "<>:div$<b>64<i>0<i>3<i>3<b>0<s>1|"
-                        + "@:class=header$<b>17<i>3<s>1|@:class=header$<b>17<i>2<s>2]"
+        fd.addTV("base", "bcbabd", "[(0-1)s:a|_1$<i>0<i>1|"
+                + "<>:s$<b>64<i>0<i>5<i>5<b>0<s>3|"
+                + "<>:div$<b>64<i>0<i>2<i>2<b>0<s>2|"
+                + "<>:div$<b>64<i>0<i>3<i>3<b>0<s>1|"
+                + "@:class=header$<b>17<i>3<s>1|@:class=header$<b>17<i>2<s>2]"
 
-                        + "[(1-2)s:e|_2$<i>1<i>2|"
-                        + "<>:a$<b>64<i>1<i>2<i>2<b>0<s>1|@:class=header$<b>17<i>2<s>1]"
+                + "[(1-2)s:e|_2$<i>1<i>2|"
+                + "<>:a$<b>64<i>1<i>2<i>2<b>0<s>1|@:class=header$<b>17<i>2<s>1]"
 
-                        + "[(2-3)s:e|_3$<i>2<i>3|"
-                        + "<>:div$<b>64<i>2<i>5<i>5<b>0<s>1|@:class=time$<b>17<i>5<s>1]"
+                + "[(2-3)s:e|_3$<i>2<i>3|"
+                + "<>:div$<b>64<i>2<i>5<i>5<b>0<s>1|@:class=time$<b>17<i>5<s>1]"
 
-                        + "[(3-4)s:a|_4$<i>3<i>4|"
-                        + "<>:div$<b>64<i>3<i>5<i>5<b>0<s>1|@:class=header$<b>17<i>5<s>1]"
+                + "[(3-4)s:a|_4$<i>3<i>4|"
+                + "<>:div$<b>64<i>3<i>5<i>5<b>0<s>1|@:class=header$<b>17<i>5<s>1]"
 
-                        + "[(4-5)s:b|_5$<i>4<i>5|"
-                        + "<>:a$<b>64<i>4<i>5<i>5<b>0<s>2|"
-                        + "<>:div$<b>64<i>4<i>5<i>5<b>0<s>1|"
-                        + "@:class=header$<b>17<i>5<s>2]"
+                + "[(4-5)s:b|_5$<i>4<i>5|" + "<>:a$<b>64<i>4<i>5<i>5<b>0<s>2|"
+                + "<>:div$<b>64<i>4<i>5<i>5<b>0<s>1|"
+                + "@:class=header$<b>17<i>5<s>2]"
 
-                        + "[(5-6)s:d|_6$<i>5<i>6|"
-                        + "<>:div$<b>64<i>5<i>6<i>6<b>0<s>2|"
-                        + "<>:s$<b>64<i>5<i>6<i>6<b>0<s>1|"
-                        + "@:class=header$<b>17<i>6<s>1]"
+                + "[(5-6)s:d|_6$<i>5<i>6|" + "<>:div$<b>64<i>5<i>6<i>6<b>0<s>2|"
+                + "<>:s$<b>64<i>5<i>6<i>6<b>0<s>1|"
+                + "@:class=header$<b>17<i>6<s>1]"
 
-                        + "[(6-7)s:d|_7$<i>6<i>7|"
-                        + "<>:s$<b>64<i>6<i>7<i>7<b>0<s>2|"
-                        + "<>:div$<b>64<i>6<i>7<i>7<b>0<s>1"
-                        + "|@:class=header$<b>17<i>7<s>1|@:class=header$<b>17<i>7<s>2]");
+                + "[(6-7)s:d|_7$<i>6<i>7|" + "<>:s$<b>64<i>6<i>7<i>7<b>0<s>2|"
+                + "<>:div$<b>64<i>6<i>7<i>7<b>0<s>1"
+                + "|@:class=header$<b>17<i>7<s>1|@:class=header$<b>17<i>7<s>2]");
 
         return fd;
     }
@@ -73,36 +67,29 @@
     private FieldDocument createFieldDoc1 () {
         fd = new FieldDocument();
         fd.addString("ID", "doc-1");
-        fd.addTV(
-                "base",
-                "bcbabd",
-                "[(0-1)s:b|_1$<i>0<i>1|"
-                        + "<>:s<b>64<i>0<i>5<i>5<b>0<s>2|"
-                        + "<>:div$<b>64<i>0<i>3<i>3<b>0<s>1|"
-                        + "@:class=header$<b>17<i>3<s>1|@:class=title$<b>17<i>3<s>1|@:class=book$<b>17<i>3<s>1]"
+        fd.addTV("base", "bcbabd", "[(0-1)s:b|_1$<i>0<i>1|"
+                + "<>:s<b>64<i>0<i>5<i>5<b>0<s>2|"
+                + "<>:div$<b>64<i>0<i>3<i>3<b>0<s>1|"
+                + "@:class=header$<b>17<i>3<s>1|@:class=title$<b>17<i>3<s>1|@:class=book$<b>17<i>3<s>1]"
 
-                        + "[(1-2)s:c|_2$<i>1<i>2|"
-                        + "<>:div$<b>64<i>1<i>2<i>2<b>0<s>1|"
-                        + "@:class=header$<b>17<i>2<s>1|@:class=title$<b>17<i>2<s>1]"
+                + "[(1-2)s:c|_2$<i>1<i>2|" + "<>:div$<b>64<i>1<i>2<i>2<b>0<s>1|"
+                + "@:class=header$<b>17<i>2<s>1|@:class=title$<b>17<i>2<s>1]"
 
-                        + "[(2-3)s:b|_3$<i>2<i>3|"
-                        + "<>:div$<b>64<i>2<i>5<i>5<b>0<s>1|@:class=book$<b>17<i>5<s>1]"
+                + "[(2-3)s:b|_3$<i>2<i>3|"
+                + "<>:div$<b>64<i>2<i>5<i>5<b>0<s>1|@:class=book$<b>17<i>5<s>1]"
 
-                        + "[(3-4)s:a|_4$<i>3<i>4|"
-                        + "<>:div$<b>64<i>3<i>5<i>5<b>0<s>1|@:class=title$<b>17<i>5<s>1]"
+                + "[(3-4)s:a|_4$<i>3<i>4|"
+                + "<>:div$<b>64<i>3<i>5<i>5<b>0<s>1|@:class=title$<b>17<i>5<s>1]"
 
-                        + "[(4-5)s:b|_5$<i>4<i>5|"
-                        + "<>:div$<b>64<i>4<i>5<i>5<b>0<s>1|"
-                        + "@:class=header$<b>17<i>5<s>1|@:class=book$<b>17<i>5<s>1|@:class=title$<b>17<i>5<s>1]"
+                + "[(4-5)s:b|_5$<i>4<i>5|" + "<>:div$<b>64<i>4<i>5<i>5<b>0<s>1|"
+                + "@:class=header$<b>17<i>5<s>1|@:class=book$<b>17<i>5<s>1|@:class=title$<b>17<i>5<s>1]"
 
-                        + "[(5-6)s:d|_6$<i>5<i>6|"
-                        + "<>:s$<b>64<i>5<i>6<i>6<b>0<s>2|"
-                        + "<>:div$<b>64<i>5<i>6<i>6<b>0<s>1|@:class=header$<b>17<i>6<s>1]"
+                + "[(5-6)s:d|_6$<i>5<i>6|" + "<>:s$<b>64<i>5<i>6<i>6<b>0<s>2|"
+                + "<>:div$<b>64<i>5<i>6<i>6<b>0<s>1|@:class=header$<b>17<i>6<s>1]"
 
-                        + "[(6-7)s:d|_7$<i>6<i>7|"
-                        + "<>:s$<b>64<i>6<i>7<i>7<b>0<s>2|"
-                        + "<>:div$<b>64<i>6<i>7<i>7<b>0<s>1|"
-                        + "@:class=header$<b>17<i>7<s>1|@:class=title$<b>17<i>7<s>1]");
+                + "[(6-7)s:d|_7$<i>6<i>7|" + "<>:s$<b>64<i>6<i>7<i>7<b>0<s>2|"
+                + "<>:div$<b>64<i>6<i>7<i>7<b>0<s>1|"
+                + "@:class=header$<b>17<i>7<s>1|@:class=title$<b>17<i>7<s>1]");
 
         return fd;
     }
@@ -111,38 +98,31 @@
     private FieldDocument createFieldDoc2 () {
         fd = new FieldDocument();
         fd.addString("ID", "doc-1");
-        fd.addTV(
-                "base",
-                "bcbabd",
-                "[(0-1)s:b|_1$<i>0<i>1|"
-                        + "<>:div$<b>64<i>0<i>3<i>3<b>0<s>2|"
-                        + "<>:s$<b>64<i>0<i>5<i>5<b>0<s>1|"
-                        + "@:class=header$<b>17<i>3<s>2|@:class=book$<b>17<i>5<s>1|@:class=book$<b>17<i>3<s>2]"
+        fd.addTV("base", "bcbabd", "[(0-1)s:b|_1$<i>0<i>1|"
+                + "<>:div$<b>64<i>0<i>3<i>3<b>0<s>2|"
+                + "<>:s$<b>64<i>0<i>5<i>5<b>0<s>1|"
+                + "@:class=header$<b>17<i>3<s>2|@:class=book$<b>17<i>5<s>1|@:class=book$<b>17<i>3<s>2]"
 
-                        + "[(1-2)s:e|_2$<i>1<i>2|"
-                        + "<>:a$<b>64<i>1<i>2<i>2<b>0<s>2|"
-                        + "<>:div$<b>64<i>1<i>2<i>2<b>0<s>1|"
-                        + "@:class=book$<b>17<i>2<s>2|@:class=header$<b>17<i>2<s>1]"
+                + "[(1-2)s:e|_2$<i>1<i>2|" + "<>:a$<b>64<i>1<i>2<i>2<b>0<s>2|"
+                + "<>:div$<b>64<i>1<i>2<i>2<b>0<s>1|"
+                + "@:class=book$<b>17<i>2<s>2|@:class=header$<b>17<i>2<s>1]"
 
-                        + "[(2-3)s:b|_3$<i>2<i>3|"
-                        + "<>:a$<b>64<i>1<i>2<i>2<b>0<s>2|"
-                        + "<>:div$<b>64<i>2<i>3<i>5<b>0<s>1|"
-                        + "@:class=header$<b>17<i>2<s>2|@:class=book$<b>17<i>5<s>1]"
+                + "[(2-3)s:b|_3$<i>2<i>3|" + "<>:a$<b>64<i>1<i>2<i>2<b>0<s>2|"
+                + "<>:div$<b>64<i>2<i>3<i>5<b>0<s>1|"
+                + "@:class=header$<b>17<i>2<s>2|@:class=book$<b>17<i>5<s>1]"
 
-                        + "[(3-4)s:a|_4$<i>3<i>4|"
-                        + "<>:div$<b>64<i>3<i>5<i>5<b>0<s>1|@:class=title$<b>17<i>5<s>1]"
+                + "[(3-4)s:a|_4$<i>3<i>4|"
+                + "<>:div$<b>64<i>3<i>5<i>5<b>0<s>1|@:class=title$<b>17<i>5<s>1]"
 
-                        + "[(4-5)s:b|_5$<i>4<i>5|"
-                        + "<>:div$<b>64<i>4<i>5<i>5<b>0<s>1|@:class=header$<b>17<i>5<s>1|@:class=book$<b>17<i>5<s>1]"
+                + "[(4-5)s:b|_5$<i>4<i>5|"
+                + "<>:div$<b>64<i>4<i>5<i>5<b>0<s>1|@:class=header$<b>17<i>5<s>1|@:class=book$<b>17<i>5<s>1]"
 
-                        + "[(5-6)s:d|_6$<i>5<i>6|"
-                        + "<>:s$<b>64<i>5<i>6<i>6<b>0<s>1|"
-                        + "<>:div$<b>64<i>5<i>6<i>6<b>0<s>1|@:class=header$<b>17<i>6<s>1]"
+                + "[(5-6)s:d|_6$<i>5<i>6|" + "<>:s$<b>64<i>5<i>6<i>6<b>0<s>1|"
+                + "<>:div$<b>64<i>5<i>6<i>6<b>0<s>1|@:class=header$<b>17<i>6<s>1]"
 
-                        + "[(6-7)s:d|_7$<i>6<i>7|"
-                        + "<>:s$<b>64<i>6<i>7<i>7<b>0<s>2|"
-                        + "<>:div$<b>64<i>6<i>7<i>7<b>0<s>1|"
-                        + "@:class=header$<b>17<i>7<s>1|@:class=book$<b>17<i>7<s>2]");
+                + "[(6-7)s:d|_7$<i>6<i>7|" + "<>:s$<b>64<i>6<i>7<i>7<b>0<s>2|"
+                + "<>:div$<b>64<i>6<i>7<i>7<b>0<s>1|"
+                + "@:class=header$<b>17<i>7<s>1|@:class=book$<b>17<i>7<s>2]");
 
         return fd;
     }
@@ -152,14 +132,14 @@
      * Test matching elementRef
      * 
      * @throws IOException
-     * */
+     */
     @Test
     public void testCase1 () throws IOException {
         ki.addDoc(createFieldDoc0());
         ki.commit();
 
-        SpanAttributeQuery saq = new SpanAttributeQuery(new SpanTermQuery(
-                new Term("base", "@:class=header")), true);
+        SpanAttributeQuery saq = new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=header")), true);
 
         SpanElementQuery seq = new SpanElementQuery("base", "div");
 
@@ -189,20 +169,20 @@
      * Test multiple attributes and negation
      * 
      * @throws IOException
-     * */
+     */
     @Test
     public void testCase2 () throws IOException {
         ki.addDoc(createFieldDoc1());
         ki.commit();
         // header and title
         List<SpanQuery> sql = new ArrayList<>();
-        sql.add(new SpanAttributeQuery(new SpanTermQuery(new Term("base",
-                "@:class=header")), true));
-        sql.add(new SpanAttributeQuery(new SpanTermQuery(new Term("base",
-                "@:class=title")), true));
+        sql.add(new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=header")), true));
+        sql.add(new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=title")), true));
 
-        SpanQuery sq = new SpanWithAttributeQuery(new SpanElementQuery("base",
-                "div"), sql, true);
+        SpanQuery sq = new SpanWithAttributeQuery(
+                new SpanElementQuery("base", "div"), sql, true);
 
         kr = ki.search(sq, (short) 10);
 
@@ -218,8 +198,9 @@
 
         // Add not Attribute
         // header and title, not book
-        sql.add(new SpanAttributeQuery(new SpanTermQuery(new Term("base",
-                "@:class=book")), true, true));
+        sql.add(new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=book")), true,
+                true));
 
         sq = new SpanWithAttributeQuery(new SpanElementQuery("base", "div"),
                 sql, true);
@@ -235,8 +216,9 @@
         // Test multiple negations
         // header, not title, not book
         sql.remove(1);
-        sql.add(new SpanAttributeQuery(new SpanTermQuery(new Term("base",
-                "@:class=title")), true, true));
+        sql.add(new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=title")), true,
+                true));
 
         sq = new SpanWithAttributeQuery(new SpanElementQuery("base", "div"),
                 sql, true);
@@ -252,17 +234,18 @@
      * Element with only not attributes
      * 
      * @throws IOException
-     * */
+     */
     @Test
     public void testcase9 () throws IOException {
 
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
-        SpanAttributeQuery saq = new SpanAttributeQuery(new SpanTermQuery(
-                new Term("base", "@:class=book")), true, true);
-        SpanQuery sq = new SpanWithAttributeQuery(new SpanElementQuery("base",
-                "div"), saq, true);
+        SpanAttributeQuery saq = new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=book")), true,
+                true);
+        SpanQuery sq = new SpanWithAttributeQuery(
+                new SpanElementQuery("base", "div"), saq, true);
 
         kr = ki.search(sq, (short) 10);
         assertEquals(4, kr.getTotalResults());
@@ -277,8 +260,9 @@
 
         List<SpanQuery> sql = new ArrayList<>();
         sql.add(saq);
-        sql.add(new SpanAttributeQuery(new SpanTermQuery(new Term("base",
-                "@:class=header")), true, true));
+        sql.add(new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=header")), true,
+                true));
         sq = new SpanWithAttributeQuery(new SpanElementQuery("base", "div"),
                 sql, true);
 
@@ -293,19 +277,20 @@
 
     /**
      * same attribute types referring to different element types
-     * */
+     */
     @Test
     public void testCase3 () throws IOException {
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
         List<SpanQuery> sql = new ArrayList<>();
-        sql.add(new SpanAttributeQuery(new SpanTermQuery(new Term("base",
-                "@:class=header")), true));
-        sql.add(new SpanAttributeQuery(new SpanTermQuery(new Term("base",
-                "@:class=book")), true, true));
-        SpanQuery sq = new SpanWithAttributeQuery(new SpanElementQuery("base",
-                "div"), sql, true);
+        sql.add(new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=header")), true));
+        sql.add(new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=book")), true,
+                true));
+        SpanQuery sq = new SpanWithAttributeQuery(
+                new SpanElementQuery("base", "div"), sql, true);
 
         kr = ki.search(sq, (short) 10);
 
@@ -327,8 +312,8 @@
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
-        SpanAttributeQuery saq = new SpanAttributeQuery(new SpanTermQuery(
-                new Term("base", "@:class=book")), true);
+        SpanAttributeQuery saq = new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=book")), true);
 
         List<SpanQuery> sql = new ArrayList<>();
         sql.add(saq);
@@ -345,8 +330,8 @@
 
         assertEquals((long) 6, kr.getTotalResults());
 
-        SpanNextQuery snq = new SpanNextQuery(new SpanTermQuery(new Term(
-                "base", "s:e")), sq);
+        SpanNextQuery snq = new SpanNextQuery(
+                new SpanTermQuery(new Term("base", "s:e")), sq);
 
         kr = ki.search(snq, (short) 10);
 
@@ -359,13 +344,13 @@
 
     /**
      * Arbitrary elements with a specific attribute.
-     * */
+     */
     @Test
     public void testCase5 () throws IOException {
         ki.addDoc(createFieldDoc2());
         ki.commit();
-        SpanAttributeQuery saq = new SpanAttributeQuery(new SpanTermQuery(
-                new Term("base", "@:class=book")), true);
+        SpanAttributeQuery saq = new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=book")), true);
 
         SpanWithAttributeQuery swaq = new SpanWithAttributeQuery(saq, true);
         kr = ki.search(swaq, (short) 10);
@@ -388,17 +373,17 @@
 
     /**
      * Arbitrary elements with multiple attributes.
-     * */
+     */
     @Test
     public void testCase6 () throws IOException {
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
         List<SpanQuery> sql = new ArrayList<>();
-        sql.add(new SpanAttributeQuery(new SpanTermQuery(new Term("base",
-                "@:class=header")), true));
-        sql.add(new SpanAttributeQuery(new SpanTermQuery(new Term("base",
-                "@:class=book")), true));
+        sql.add(new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=header")), true));
+        sql.add(new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=book")), true));
 
         SpanWithAttributeQuery swaq = new SpanWithAttributeQuery(sql, true);
         kr = ki.search(swaq, (short) 10);
@@ -414,17 +399,18 @@
 
     /**
      * Arbitrary elements with an attribute and a not attribute.
-     * */
+     */
     @Test
     public void testCase7 () throws IOException {
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
         List<SpanQuery> sql = new ArrayList<>();
-        sql.add(new SpanAttributeQuery(new SpanTermQuery(new Term("base",
-                "@:class=header")), true, true));
-        sql.add(new SpanAttributeQuery(new SpanTermQuery(new Term("base",
-                "@:class=book")), true));
+        sql.add(new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=header")), true,
+                true));
+        sql.add(new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=book")), true));
 
         SpanWithAttributeQuery swaq = new SpanWithAttributeQuery(sql, true);
         kr = ki.search(swaq, (short) 10);
@@ -448,17 +434,19 @@
 
     /**
      * Arbitrary elements with only not attributes.
-     * */
+     */
     @Test(expected = IllegalArgumentException.class)
     public void testCase8 () throws IOException {
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
         List<SpanQuery> sql = new ArrayList<>();
-        sql.add(new SpanAttributeQuery(new SpanTermQuery(new Term("base",
-                "@:class=header")), true, true));
-        sql.add(new SpanAttributeQuery(new SpanTermQuery(new Term("base",
-                "@:class=book")), true, true));
+        sql.add(new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=header")), true,
+                true));
+        sql.add(new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:class=book")), true,
+                true));
 
         SpanWithAttributeQuery swaq = new SpanWithAttributeQuery(sql, true);
         kr = ki.search(swaq, (short) 10);
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestClassFilterIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestClassFilterIndex.java
index 8536540..2496df7 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestClassFilterIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestClassFilterIndex.java
@@ -57,16 +57,16 @@
         assertEquals(18, kr.getMatch(1).getEndPos());
         assertEquals(
                 "Frankenstein, treat my daughter well. She [[{2:is {1:the one} that saved "
-                        + "your master who you hold so dear}]].", kr
-                        .getMatch(1).getSnippetBrackets());
+                        + "your master who you hold so dear}]].",
+                kr.getMatch(1).getSnippetBrackets());
         assertEquals(
                 "Frankenstein, treat my daughter well. She [[{2:is {1:the one that "
-                        + "saved your master who you hold so dear}}]].", kr
-                        .getMatch(2).getSnippetBrackets());
+                        + "saved your master who you hold so dear}}]].",
+                kr.getMatch(2).getSnippetBrackets());
         assertEquals(
                 "Frankenstein, treat my daughter well. She [[{2:is the one that "
-                        + "saved {1:your master} who you hold so dear}]].", kr
-                        .getMatch(3).getSnippetBrackets());
+                        + "saved {1:your master} who you hold so dear}]].",
+                kr.getMatch(3).getSnippetBrackets());
         assertEquals(
                 "Frankenstein, treat my daughter well. She [[{2:is the one that saved your master who {1:you} hold so dear}]].",
                 kr.getMatch(4).getSnippetBrackets());
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestClassIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestClassIndex.java
index d9f1acf..b3e0301 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestClassIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestClassIndex.java
@@ -47,13 +47,13 @@
         assertEquals("totalResults", kr.getTotalResults(), 1);
         assertEquals("StartPos (0)", 7, kr.getMatch(0).startPos);
         assertEquals("EndPos (0)", 9, kr.getMatch(0).endPos);
-        assertEquals("SnippetBrackets (0)", "... bcabca[[ba]]c", kr.getMatch(0)
-                .getSnippetBrackets());
-        assertEquals(
-                "SnippetHTML (0)",
+        assertEquals("SnippetBrackets (0)", "... bcabca[[ba]]c",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("SnippetHTML (0)",
                 "<span class=\"context-left\"><span class=\"more\">"
                         + "</span>bcabca</span><span class=\"match\"><mark>ba</mark></span><span class=\"context-right"
-                        + "\">c</span>", kr.getMatch(0).getSnippetHTML());
+                        + "\">c</span>",
+                kr.getMatch(0).getSnippetHTML());
 
         sq = new SpanTermQuery(new Term("base", "s:b"));
         kr = ki.search(sq, (short) 10);
@@ -61,24 +61,23 @@
         assertEquals("totalResults", kr.getTotalResults(), 3);
         assertEquals("StartPos (0)", 1, kr.getMatch(0).startPos);
         assertEquals("EndPos (0)", 2, kr.getMatch(0).endPos);
-        assertEquals("SnippetBrackets (0)", "a[[b]]cabcab ...", kr.getMatch(0)
-                .getSnippetBrackets());
+        assertEquals("SnippetBrackets (0)", "a[[b]]cabcab ...",
+                kr.getMatch(0).getSnippetBrackets());
 
 
-        assertEquals(
-                "SnippetHTML (0)",
+        assertEquals("SnippetHTML (0)",
                 "<span class=\"context-left\">a</span><span class=\"match\"><mark>"
                         + "b</mark></span><span class=\"context-right\">cabcab<span class=\"more\"></span></span>",
                 kr.getMatch(0).getSnippetHTML());
 
         assertEquals("StartPos (1)", 4, kr.getMatch(1).startPos);
         assertEquals("EndPos (1)", 5, kr.getMatch(1).endPos);
-        assertEquals("SnippetBrackets (1)", "abca[[b]]cabac", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("SnippetBrackets (1)", "abca[[b]]cabac",
+                kr.getMatch(1).getSnippetBrackets());
         assertEquals("StartPos (2)", 7, kr.getMatch(2).startPos);
         assertEquals("EndPos (2)", 8, kr.getMatch(2).endPos);
-        assertEquals("SnippetBrackets (2)", "... bcabca[[b]]ac", kr.getMatch(2)
-                .getSnippetBrackets());
+        assertEquals("SnippetBrackets (2)", "... bcabca[[b]]ac",
+                kr.getMatch(2).getSnippetBrackets());
 
         sq = new SpanClassQuery(new SpanTermQuery(new Term("base", "s:b")));
         kr = ki.search(sq, (short) 10);
@@ -86,24 +85,23 @@
         assertEquals("totalResults", kr.getTotalResults(), 3);
         assertEquals("StartPos (0)", 1, kr.getMatch(0).startPos);
         assertEquals("EndPos (0)", 2, kr.getMatch(0).endPos);
-        assertEquals("snippetBrackets (0)", "a[[{1:b}]]cabcab ...", kr
-                .getMatch(0).getSnippetBrackets());
-        assertEquals(
-                "snippetHTML (0)",
+        assertEquals("snippetBrackets (0)", "a[[{1:b}]]cabcab ...",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("snippetHTML (0)",
                 "<span class=\"context-left\">a</span><span class=\"match\"><mark>"
                         + "<mark class=\"class-1 level-0\">b</mark></mark></span><span class=\"context-right\">cabcab<span "
-                        + "class=\"more\"></span></span>", kr.getMatch(0)
-                        .getSnippetHTML());
+                        + "class=\"more\"></span></span>",
+                kr.getMatch(0).getSnippetHTML());
 
         assertEquals("StartPos (1)", 4, kr.getMatch(1).startPos);
         assertEquals("EndPos (1)", 5, kr.getMatch(1).endPos);
-        assertEquals("snippetBrackets (1)", "abca[[{1:b}]]cabac", kr
-                .getMatch(1).getSnippetBrackets());
+        assertEquals("snippetBrackets (1)", "abca[[{1:b}]]cabac",
+                kr.getMatch(1).getSnippetBrackets());
 
         assertEquals("StartPos (2)", 7, kr.getMatch(2).startPos);
         assertEquals("EndPos (2)", 8, kr.getMatch(2).endPos);
-        assertEquals("snippetBrackets (2)", "... bcabca[[{1:b}]]ac", kr
-                .getMatch(2).getSnippetBrackets());
+        assertEquals("snippetBrackets (2)", "... bcabca[[{1:b}]]ac",
+                kr.getMatch(2).getSnippetBrackets());
 
 
         sq = new SpanNextQuery(new SpanTermQuery(new Term("base", "s:a")),
@@ -115,87 +113,89 @@
         assertEquals("totalResults", kr.getTotalResults(), 3);
         assertEquals("StartPos (0)", 0, kr.getMatch(0).startPos);
         assertEquals("EndPos (0)", 2, kr.getMatch(0).endPos);
-        assertEquals("SnippetBrackets (0)", "[[a{1:b}]]cabcab ...", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("SnippetBrackets (0)", "[[a{1:b}]]cabcab ...",
+                kr.getMatch(0).getSnippetBrackets());
 
-        assertEquals(
-                "SnippetHTML (0)",
+        assertEquals("SnippetHTML (0)",
                 "<span class=\"context-left\"></span><span class=\"match\"><mark>a<mark class=\"class-1 level-0\">b</mark></mark></span><span class=\"context-right\">cabcab<span class=\"more\"></span></span>",
                 kr.getMatch(0).getSnippetHTML());
 
         assertEquals("StartPos (1)", 3, kr.getMatch(1).startPos);
         assertEquals("EndPos (1)", 5, kr.getMatch(1).endPos);
-        assertEquals("SnippetBrackets (1)", "abc[[a{1:b}]]cabac", kr
-                .getMatch(1).getSnippetBrackets());
+        assertEquals("SnippetBrackets (1)", "abc[[a{1:b}]]cabac",
+                kr.getMatch(1).getSnippetBrackets());
         assertEquals("StartPos (2)", 6, kr.getMatch(2).startPos);
         assertEquals("EndPos (2)", 8, kr.getMatch(2).endPos);
-        assertEquals("SnippetBrackets (2)", "abcabc[[a{1:b}]]ac", kr
-                .getMatch(2).getSnippetBrackets());
+        assertEquals("SnippetBrackets (2)", "abcabc[[a{1:b}]]ac",
+                kr.getMatch(2).getSnippetBrackets());
 
 
         // abcabcabac
-        sq = new SpanNextQuery(new SpanClassQuery(new SpanTermQuery(new Term(
-                "base", "s:a")), (byte) 2), new SpanClassQuery(
-                new SpanTermQuery(new Term("base", "s:b")), (byte) 3));
+        sq = new SpanNextQuery(
+                new SpanClassQuery(new SpanTermQuery(new Term("base", "s:a")),
+                        (byte) 2),
+                new SpanClassQuery(new SpanTermQuery(new Term("base", "s:b")),
+                        (byte) 3));
 
         kr = ki.search(sq, (short) 10);
 
         assertEquals("StartPos (0)", 0, kr.getMatch(0).startPos);
         assertEquals("EndPos (0)", 2, kr.getMatch(0).endPos);
-        assertEquals("SnippetBrackets (0)", "[[{2:a}{3:b}]]cabcab ...", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("SnippetBrackets (0)", "[[{2:a}{3:b}]]cabcab ...",
+                kr.getMatch(0).getSnippetBrackets());
         assertEquals("StartPos (1)", 3, kr.getMatch(1).startPos);
         assertEquals("EndPos (1)", 5, kr.getMatch(1).endPos);
-        assertEquals("SnippetBrackets (1)", "abc[[{2:a}{3:b}]]cabac", kr
-                .getMatch(1).getSnippetBrackets());
+        assertEquals("SnippetBrackets (1)", "abc[[{2:a}{3:b}]]cabac",
+                kr.getMatch(1).getSnippetBrackets());
 
         assertEquals("StartPos (2)", 6, kr.getMatch(2).startPos);
         assertEquals("EndPos (2)", 8, kr.getMatch(2).endPos);
-        assertEquals("SnippetBrackets (2)", "abcabc[[{2:a}{3:b}]]ac", kr
-                .getMatch(2).getSnippetBrackets());
+        assertEquals("SnippetBrackets (2)", "abcabc[[{2:a}{3:b}]]ac",
+                kr.getMatch(2).getSnippetBrackets());
 
         // abcabcabac
         sq = new SpanNextQuery(new SpanTermQuery(new Term("base", "s:a")),
-                new SpanClassQuery(new SpanNextQuery(new SpanTermQuery(
-                        new Term("base", "s:b")), new SpanClassQuery(
-                        new SpanTermQuery(new Term("base", "s:a")))), (byte) 2));
+                new SpanClassQuery(new SpanNextQuery(
+                        new SpanTermQuery(new Term("base", "s:b")),
+                        new SpanClassQuery(
+                                new SpanTermQuery(new Term("base", "s:a")))),
+                        (byte) 2));
 
         kr = ki.search(sq, (short) 10);
 
         assertEquals("totalResults", kr.getTotalResults(), 1);
-        assertEquals("SnippetBrackets (0)", "abcabc[[a{2:b{1:a}}]]c", kr
-                .getMatch(0).getSnippetBrackets());
-        assertEquals(
-                "SnippetHTML (0)",
+        assertEquals("SnippetBrackets (0)", "abcabc[[a{2:b{1:a}}]]c",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("SnippetHTML (0)",
                 "<span class=\"context-left\">abcabc</span><span class=\"match\"><mark>a<mark class=\"class-2 level-0\">b<mark class=\"class-1 level-1\">a</mark></mark></mark></span><span class=\"context-right\">c</span>",
                 kr.getMatch(0).getSnippetHTML());
 
         // Offset tokens
         kr = ki.search(sq, 0, (short) 10, true, (short) 2, true, (short) 2);
         assertEquals("totalResults", kr.getTotalResults(), 1);
-        assertEquals("SnippetBrackets (0)", "... bc[[a{2:b{1:a}}]]c", kr
-                .getMatch(0).getSnippetBrackets());
-        assertEquals(
-                "SnippetHTML (0)",
+        assertEquals("SnippetBrackets (0)", "... bc[[a{2:b{1:a}}]]c",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("SnippetHTML (0)",
                 "<span class=\"context-left\"><span class=\"more\"></span>bc</span><span class=\"match\"><mark>a<mark class=\"class-2 level-0\">b<mark class=\"class-1 level-1\">a</mark></mark></mark></span><span class=\"context-right\">c</span>",
                 kr.getMatch(0).getSnippetHTML());
 
         // Offset Characters
         kr = ki.search(sq, 0, (short) 10, false, (short) 2, false, (short) 2);
         assertEquals("totalResults", kr.getTotalResults(), 1);
-        assertEquals("SnippetBrackets (0)", "... bc[[a{2:b{1:a}}]]c", kr
-                .getMatch(0).getSnippetBrackets());
-        assertEquals(
-                "SnippetHTML (0)",
+        assertEquals("SnippetBrackets (0)", "... bc[[a{2:b{1:a}}]]c",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("SnippetHTML (0)",
                 "<span class=\"context-left\"><span class=\"more\"></span>bc</span><span class=\"match\"><mark>a<mark class=\"class-2 level-0\">b<mark class=\"class-1 level-1\">a</mark></mark></mark></span><span class=\"context-right\">c</span>",
                 kr.getMatch(0).getSnippetHTML());
 
 
         // System.err.println(kr.toJSON());
 
-        sq = new SpanNextQuery(new SpanClassQuery(new SpanTermQuery(new Term(
-                "base", "s:b")), (byte) 1), new SpanClassQuery(
-                new SpanTermQuery(new Term("base", "s:c")), (byte) 2));
+        sq = new SpanNextQuery(
+                new SpanClassQuery(new SpanTermQuery(new Term("base", "s:b")),
+                        (byte) 1),
+                new SpanClassQuery(new SpanTermQuery(new Term("base", "s:c")),
+                        (byte) 2));
 
         kr = ki.search(sq, (short) 10);
 
@@ -210,9 +210,9 @@
 
 
         sq = new SpanNextQuery(new SpanTermQuery(new Term("base", "s:a")),
-                new SpanClassQuery(new SpanNextQuery(new SpanTermQuery(
-                        new Term("base", "s:b")), new SpanTermQuery(new Term(
-                        "base", "s:c")))));
+                new SpanClassQuery(new SpanNextQuery(
+                        new SpanTermQuery(new Term("base", "s:b")),
+                        new SpanTermQuery(new Term("base", "s:c")))));
 
         kr = ki.search(sq, (short) 2);
 
@@ -238,7 +238,8 @@
                 + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7]"
                 + "[(4-5)s:b|i:b|_4$<i>4<i>5]" + "[(5-6)s:c|i:c|_5$<i>5<i>6]"
                 + "[(6-7)s:a|i:a|_6$<i>6<i>7]" + "[(7-8)s:b|i:b|_7$<i>7<i>8]"
-                + "[(8-9)s:a|i:a|_8$<i>8<i>9]" + "[(9-10)s:c|i:c|_9$<i>9<i>10]");
+                + "[(8-9)s:a|i:a|_8$<i>8<i>9]"
+                + "[(9-10)s:c|i:c|_9$<i>9<i>10]");
         ki.addDoc(fd);
 
         ki.commit();
@@ -264,7 +265,7 @@
         kr = ki.search(sq, (short) 10);
         assertEquals("abc[abcab}ac]", kr.getMatch(0).getSnippetBrackets());
         System.err.println();
-
+        
         */
 
         /*
@@ -274,12 +275,12 @@
                   new SpanTermQuery(new Term("base", "s:a"))
                 )
             );
-
+        
                //	       new SpanTermQuery(new Term("base", "s:a")),
             //            new SpanClassQuery(
             //            )
             //        );
-
+        
         */
 
     }
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestDistanceExclusionIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestDistanceExclusionIndex.java
index dbc3b72..0ef4ae5 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestDistanceExclusionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestDistanceExclusionIndex.java
@@ -24,7 +24,7 @@
 
     /**
      * Ordered, unordered
-     * */
+     */
     @Test
     public void testCase1 () throws IOException {
         ki = new KrillIndex();
@@ -52,7 +52,7 @@
     /**
      * Multiple docs, unordered
      * No more secondSpans
-     * */
+     */
     @Test
     public void testCase2 () throws IOException {
         ki = new KrillIndex();
@@ -71,7 +71,7 @@
     /**
      * Secondspans' document number is bigger than firstspans'
      * Actual distance is smaller than min distance.
-     * */
+     */
     @Test
     public void testCase3 () throws IOException {
         ki = new KrillIndex();
@@ -90,7 +90,7 @@
     /**
      * Unordered: firstspan in on the right side of the secondspan,
      * but within max distance.
-     * */
+     */
     @Test
     public void testCase4 () throws IOException {
         ki = new KrillIndex();
@@ -109,7 +109,7 @@
 
     /**
      * Element queries
-     * */
+     */
     @Test
     public void testCase5 () throws IOException {
         ki = new KrillIndex();
@@ -118,8 +118,8 @@
 
         SpanDistanceQuery sq;
         sq = new SpanDistanceQuery(new SpanElementQuery("base", "x"),
-                new SpanElementQuery("base", "y"), new DistanceConstraint(0, 1,
-                        false, true), true);
+                new SpanElementQuery("base", "y"),
+                new DistanceConstraint(0, 1, false, true), true);
 
         kr = ki.search(sq, (short) 10);
 
@@ -168,8 +168,9 @@
 
     private SpanQuery createQuery (String x, String y, int min, int max,
             boolean isOrdered) {
-        SpanDistanceQuery sq = new SpanDistanceQuery(new SpanTermQuery(
-                new Term("base", x)), new SpanTermQuery(new Term("base", y)),
+        SpanDistanceQuery sq = new SpanDistanceQuery(
+                new SpanTermQuery(new Term("base", x)),
+                new SpanTermQuery(new Term("base", y)),
                 new DistanceConstraint(min, max, isOrdered, true), true);
         return sq;
     }
@@ -195,10 +196,10 @@
     private FieldDocument createFieldDoc1 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
-        fd.addTV("base", "text", "[(0-1)s:b|s:c|_1$<i>0<i>1]"
-                + "[(1-2)s:b|_2$<i>1<i>2]" + "[(2-3)s:c|_3$<i>2<i>3]"
-                + "[(3-4)s:c|_4$<i>3<i>4]" + "[(4-5)s:d|_5$<i>4<i>5]"
-                + "[(5-6)s:d|_6$<i>5<i>6]");
+        fd.addTV("base", "text",
+                "[(0-1)s:b|s:c|_1$<i>0<i>1]" + "[(1-2)s:b|_2$<i>1<i>2]"
+                        + "[(2-3)s:c|_3$<i>2<i>3]" + "[(3-4)s:c|_4$<i>3<i>4]"
+                        + "[(4-5)s:d|_5$<i>4<i>5]" + "[(5-6)s:d|_6$<i>5<i>6]");
         return fd;
     }
 
@@ -206,12 +207,13 @@
     private FieldDocument createFieldDoc2 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
-        fd.addTV("base", "text", "[(0-1)s:b|_1$<i>0<i>1]"
-                + "[(1-2)s:b|_2$<i>1<i>2]" + "[(2-3)s:c|_3$<i>2<i>3]"
-                + "[(3-4)s:c|_4$<i>3<i>4]" + "[(4-5)s:b|_5$<i>4<i>5]"
-                + "[(5-6)s:d|_6$<i>5<i>6]" + "[(6-7)s:b|_7$<i>6<i>7]"
-                + "[(7-8)s:d|_8$<i>7<i>8]" + "[(8-9)s:c|_9$<i>8<i>9]"
-                + "[(9-10)s:d|_10$<i>9<i>10]");
+        fd.addTV("base", "text",
+                "[(0-1)s:b|_1$<i>0<i>1]" + "[(1-2)s:b|_2$<i>1<i>2]"
+                        + "[(2-3)s:c|_3$<i>2<i>3]" + "[(3-4)s:c|_4$<i>3<i>4]"
+                        + "[(4-5)s:b|_5$<i>4<i>5]" + "[(5-6)s:d|_6$<i>5<i>6]"
+                        + "[(6-7)s:b|_7$<i>6<i>7]" + "[(7-8)s:d|_8$<i>7<i>8]"
+                        + "[(8-9)s:c|_9$<i>8<i>9]"
+                        + "[(9-10)s:d|_10$<i>9<i>10]");
         return fd;
     }
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestDistanceIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestDistanceIndex.java
index 39d2392..a425578 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestDistanceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestDistanceIndex.java
@@ -27,10 +27,10 @@
     private FieldDocument createFieldDoc0 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
-        fd.addTV("base", "text", "[(0-1)s:b|s:c|_1$<i>0<i>1]"
-                + "[(1-2)s:b|_2$<i>1<i>2]" + "[(2-3)s:c|_3$<i>2<i>3]"
-                + "[(3-4)s:c|_4$<i>3<i>4]" + "[(4-5)s:d|_5$<i>4<i>5]"
-                + "[(5-6)s:d|_6$<i>5<i>6]");
+        fd.addTV("base", "text",
+                "[(0-1)s:b|s:c|_1$<i>0<i>1]" + "[(1-2)s:b|_2$<i>1<i>2]"
+                        + "[(2-3)s:c|_3$<i>2<i>3]" + "[(3-4)s:c|_4$<i>3<i>4]"
+                        + "[(4-5)s:d|_5$<i>4<i>5]" + "[(5-6)s:d|_6$<i>5<i>6]");
         return fd;
     }
 
@@ -38,16 +38,16 @@
     private FieldDocument createFieldDoc1 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
-        fd.addTV("base", "text", "[(0-1)s:c|_1$<i>0<i>1]"
-                + "[(1-2)s:e|_2$<i>1<i>2]"
-                + "[(2-3)s:c|_3$<i>2<i>3|<>:y$<b>64<i>2<i>4<i>4<b>0]"
-                + "[(3-4)s:c|_4$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7<b>0]"
-                + "[(4-5)s:d|_5$<i>4<i>5|<>:y$<b>64<i>4<i>6<i>6<b>0]"
-                + "[(5-6)s:c|_6$<i>5<i>6|<>:y$<b>64<i>5<i>8<i>8<b>0]"
-                + "[(6-7)s:d|_7$<i>6<i>7]"
-                + "[(7-8)s:e|_8$<i>7<i>8|<>:x$<b>64<i>7<i>9<i>9<b>0]"
-                + "[(8-9)s:e|_9$<i>8<i>9|<>:x$<b>64<i>8<i>10<i>10<b>0]"
-                + "[(9-10)s:d|_10$<i>9<i>10]");
+        fd.addTV("base", "text",
+                "[(0-1)s:c|_1$<i>0<i>1]" + "[(1-2)s:e|_2$<i>1<i>2]"
+                        + "[(2-3)s:c|_3$<i>2<i>3|<>:y$<b>64<i>2<i>4<i>4<b>0]"
+                        + "[(3-4)s:c|_4$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7<b>0]"
+                        + "[(4-5)s:d|_5$<i>4<i>5|<>:y$<b>64<i>4<i>6<i>6<b>0]"
+                        + "[(5-6)s:c|_6$<i>5<i>6|<>:y$<b>64<i>5<i>8<i>8<b>0]"
+                        + "[(6-7)s:d|_7$<i>6<i>7]"
+                        + "[(7-8)s:e|_8$<i>7<i>8|<>:x$<b>64<i>7<i>9<i>9<b>0]"
+                        + "[(8-9)s:e|_9$<i>8<i>9|<>:x$<b>64<i>8<i>10<i>10<b>0]"
+                        + "[(9-10)s:d|_10$<i>9<i>10]");
         return fd;
     }
 
@@ -55,18 +55,19 @@
     private FieldDocument createFieldDoc2 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
-        fd.addTV("base", "text", "[(0-1)s:b|_1$<i>0<i>1]"
-                + "[(1-2)s:b|_2$<i>1<i>2]" + "[(2-3)s:d|_3$<i>2<i>3]"
-                + "[(3-4)s:e|_4$<i>3<i>4]" + "[(4-5)s:d|_5$<i>4<i>5]"
-                + "[(5-6)s:e|_6$<i>5<i>6]");
+        fd.addTV("base", "text",
+                "[(0-1)s:b|_1$<i>0<i>1]" + "[(1-2)s:b|_2$<i>1<i>2]"
+                        + "[(2-3)s:d|_3$<i>2<i>3]" + "[(3-4)s:e|_4$<i>3<i>4]"
+                        + "[(4-5)s:d|_5$<i>4<i>5]" + "[(5-6)s:e|_6$<i>5<i>6]");
         return fd;
     }
 
 
     private SpanQuery createQuery (String x, String y, int min, int max,
             boolean isOrdered) {
-        SpanQuery sq = new SpanDistanceQuery(new SpanTermQuery(new Term("base",
-                x)), new SpanTermQuery(new Term("base", y)),
+        SpanQuery sq = new SpanDistanceQuery(
+                new SpanTermQuery(new Term("base", x)),
+                new SpanTermQuery(new Term("base", y)),
                 new DistanceConstraint(min, max, isOrdered, false), true);
         return sq;
     }
@@ -75,8 +76,8 @@
     private SpanQuery createElementQuery (String x, String y, int min, int max,
             boolean isOrdered) {
         SpanQuery sq = new SpanDistanceQuery(new SpanElementQuery("base", x),
-                new SpanElementQuery("base", y), new DistanceConstraint(min,
-                        max, isOrdered, false), true);
+                new SpanElementQuery("base", y),
+                new DistanceConstraint(min, max, isOrdered, false), true);
         return sq;
     }
 
@@ -85,7 +86,7 @@
      * - Intersection
      * - Multiple occurrences in the same doc
      * - hasMoreFirstSpans = false for the current secondspan
-     * */
+     */
     @Test
     public void testCase1 () throws IOException {
         ki = new KrillIndex();
@@ -128,7 +129,7 @@
      * from
      * the current secondspan
      * - Add new candidates
-     * */
+     */
     @Test
     public void testCase2 () throws IOException {
         ki = new KrillIndex();
@@ -162,7 +163,7 @@
     /**
      * - Ensure the same document
      * - Multiple matches in multiple documents and atomic indices
-     * */
+     */
     @Test
     public void testCase3 () throws IOException {
         ki = new KrillIndex();
@@ -185,7 +186,7 @@
      * still a secondspans in the same doc
      * - hasMoreFirstSpan and secondspans.next() are true,
      * but ensureSameDoc() = false
-     * */
+     */
     @Test
     public void testCase4 () throws IOException {
         ki = new KrillIndex();
@@ -277,8 +278,9 @@
         assertEquals(9, kr.getMatch(2).endPos);
 
         // The secondspans is skipped to doc# of the current firstspans
-        SpanQuery sq = new SpanSegmentQuery(createQuery("s:d", "s:e", 3, 4,
-                true), createElementQuery("y", "x", 1, 2, true));
+        SpanQuery sq = new SpanSegmentQuery(
+                createQuery("s:d", "s:e", 3, 4, true),
+                createElementQuery("y", "x", 1, 2, true));
         kr = ki.search(sq, (short) 10);
 
         assertEquals(kr.getTotalResults(), 1);
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceExclusionIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceExclusionIndex.java
index 23b6ac8..e2aa270 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceExclusionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceExclusionIndex.java
@@ -25,8 +25,9 @@
     private SpanQuery createQuery (String e, String x, String y, int min,
             int max, boolean isOrdered, boolean exclusion) {
         SpanElementQuery eq = new SpanElementQuery("base", e);
-        SpanDistanceQuery sq = new SpanDistanceQuery(new SpanTermQuery(
-                new Term("base", x)), new SpanTermQuery(new Term("base", y)),
+        SpanDistanceQuery sq = new SpanDistanceQuery(
+                new SpanTermQuery(new Term("base", x)),
+                new SpanTermQuery(new Term("base", y)),
                 new DistanceConstraint(eq, min, max, isOrdered, exclusion),
                 true);
         return sq;
@@ -87,7 +88,7 @@
     /**
      * Distance Zero, unordered
      * There is a secondspan on the right side
-     * */
+     */
     @Test
     public void testCase1 () throws IOException {
         ki = new KrillIndex();
@@ -105,7 +106,7 @@
     /**
      * There is another firstspan within max distance
      * Unordered
-     * */
+     */
     @Test
     public void testCase2 () throws IOException {
         ki = new KrillIndex();
@@ -130,7 +131,7 @@
 
     /**
      * Distance 0-1, ordered, unordered
-     * */
+     */
     @Test
     public void testCase3 () throws IOException {
         ki = new KrillIndex();
@@ -158,7 +159,7 @@
     /**
      * Multiple documents, ordered
      * No more secondspans, but there is still a firstspan
-     * */
+     */
     @Test
     public void testCase4 () throws IOException {
         ki = new KrillIndex();
@@ -183,7 +184,7 @@
 
     /**
      * Skip to
-     * */
+     */
     @Test
     public void testCase5 () throws IOException {
         ki = new KrillIndex();
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java
index 7716322..8ecc031 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestElementDistanceIndex.java
@@ -49,9 +49,7 @@
     private FieldDocument createFieldDoc1 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
-        fd.addTV(
-                "tokens",
-                "ecebdc",
+        fd.addTV("tokens", "ecebdc",
                 "[(0-1)s:e|_1$<i>0<i>1|<>:base/s:t$<b>64<i>0<i>6<i>6<b>0|<>:s$<b>64<i>0<i>2<i>1<b>0]"
                         + "[(1-2)s:c|s:b|_2$<i>1<i>2|<>:s$<b>64<i>1<i>2<i>2<b>0]"
                         + "[(2-3)s:e|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>3<b>0]"
@@ -105,7 +103,7 @@
      * Ensure terms and elements are in the same doc
      * Ensure terms are in elements
      * Check filter candidate list
-     * */
+     */
     @Test
     public void testCase1 () throws IOException {
         //System.out.println("testCase1");
@@ -129,7 +127,7 @@
 
     /**
      * Ensure terms and elements are in the same doc
-     * */
+     */
     @Test
     public void testCase2 () throws IOException {
         //System.out.println("testCase2");
@@ -206,8 +204,9 @@
         ki.addDoc(getClass().getResourceAsStream("/wiki/00001.json.gz"), true);
         ki.commit();
 
-        String jsonPath = URLDecoder.decode(getClass().getResource("/queries/cosmas1.json")
-                .getFile(),"UTF-8");
+        String jsonPath = URLDecoder.decode(
+                getClass().getResource("/queries/cosmas1.json").getFile(),
+                "UTF-8");
         SpanQueryWrapper sqwi = jsonQuery(jsonPath);
         kr = ki.search(sqwi.toQuery(), (short) 10);
 
@@ -235,8 +234,9 @@
         assertEquals(kr.getTotalResults(), 1);
         assertEquals("[[ecebdc]]", kr.getMatch(0).getSnippetBrackets());
 
-        String jsonPath = URLDecoder.decode(getClass().getResource("/queries/distances/in-same-t.jsonld")
-                .getFile(),"UTF-8");
+        String jsonPath = URLDecoder.decode(getClass()
+                .getResource("/queries/distances/in-same-t.jsonld").getFile(),
+                "UTF-8");
         sqwi = jsonQuery(jsonPath);
 
         assertEquals(
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestElementIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestElementIndex.java
index 3c83f4f..5cd2d80 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestElementIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestElementIndex.java
@@ -80,12 +80,13 @@
 
         // <a><a><a>h</a>hhij</a>hij</a>hij</a>
         FieldDocument fd = new FieldDocument();
-        fd.addTV("base", "h  h        i  j   h  i  j  h  i  j  ", "[(0-3)s:h|"
-                + "<>:a$<b>64<i>0<i>18<i>3<b>0|"
-                + "<>:a$<b>64<i>0<i>27<i>6<b>0|" + "<>:a$<b>64<i>0<i>36<i>9]"
-                + "[(3-6)s:h]" + "[(12-15)s:i<b>0]" + "[(15-18)s:j]"
-                + "[(18-21)s:h]" + "[(21-24)s:i]" + "[(24-27)s:j]"
-                + "[(27-30)s:h]" + "[(30-33)s:i]" + "[(33-36)s:j]");
+        fd.addTV("base", "h  h        i  j   h  i  j  h  i  j  ",
+                "[(0-3)s:h|" + "<>:a$<b>64<i>0<i>18<i>3<b>0|"
+                        + "<>:a$<b>64<i>0<i>27<i>6<b>0|"
+                        + "<>:a$<b>64<i>0<i>36<i>9]" + "[(3-6)s:h]"
+                        + "[(12-15)s:i<b>0]" + "[(15-18)s:j]" + "[(18-21)s:h]"
+                        + "[(21-24)s:i]" + "[(24-27)s:j]" + "[(27-30)s:h]"
+                        + "[(30-33)s:i]" + "[(33-36)s:j]");
         ki.addDoc(fd);
 
         // Save documents
@@ -131,15 +132,13 @@
 
         // xyz
         fd = new FieldDocument();
-        fd.addTV("base", "x  y  z  ", "[(0-3)s:x]" + "[(3-6)s:y]"
-                + "[(6-9)s:z]");
+        fd.addTV("base", "x  y  z  ",
+                "[(0-3)s:x]" + "[(3-6)s:y]" + "[(6-9)s:z]");
         ki.addDoc(fd);
 
         // <a>x<a><b>y<a>zcde</a>cde</b></a>cde</a>
         fd = new FieldDocument();
-        fd.addTV(
-                "base",
-                "x  y  z  k  l  m  k  l  m  k  l  m  ",
+        fd.addTV("base", "x  y  z  k  l  m  k  l  m  k  l  m  ",
                 "[(0-3)s:x|<>:a$<b>64<i>0<i>3<i>12<b>0]"
                         + "[(3-6)s:y|<>:a$<b>64<i>3<i>6<i>9<b>0|<>:b$<b>64<i>3<i>6<i>9<b>0]"
                         + "[(6-9)s:z|<>:a$<b>64<i>6<i>9<i>6<b>0]"
@@ -150,19 +149,19 @@
 
         // <a><a><a>h</a>hhij</a>hij</a>hij</a>
         fd = new FieldDocument();
-        fd.addTV("base", "h  h        i  j  h  i  j  h  i  j  ", "[(0-3)s:h|"
-                + "<>:a$<b>64<i>0<i>18<i>3<b>0|"
-                + "<>:a$<b>64<i>0<i>27<i>6<b>0|"
-                + "<>:a$<b>64<i>0<i>36<i>9<b>0]" + "[(3-6)s:h]"
-                + "[(12-15)s:i]" + "[(15-18)s:j]" + "[(18-21)s:h]"
-                + "[(21-24)s:i]" + "[(24-27)s:j]" + "[(27-30)s:h]"
-                + "[(30-33)s:i]" + "[(33-36)s:j]");
+        fd.addTV("base", "h  h        i  j  h  i  j  h  i  j  ",
+                "[(0-3)s:h|" + "<>:a$<b>64<i>0<i>18<i>3<b>0|"
+                        + "<>:a$<b>64<i>0<i>27<i>6<b>0|"
+                        + "<>:a$<b>64<i>0<i>36<i>9<b>0]" + "[(3-6)s:h]"
+                        + "[(12-15)s:i]" + "[(15-18)s:j]" + "[(18-21)s:h]"
+                        + "[(21-24)s:i]" + "[(24-27)s:j]" + "[(27-30)s:h]"
+                        + "[(30-33)s:i]" + "[(33-36)s:j]");
         ki.addDoc(fd);
 
         // xyz
         fd = new FieldDocument();
-        fd.addTV("base", "a  b  c  ", "[(0-3)s:a]" + "[(3-6)s:b]"
-                + "[(6-9)s:c]");
+        fd.addTV("base", "a  b  c  ",
+                "[(0-3)s:a]" + "[(3-6)s:b]" + "[(6-9)s:c]");
         ki.addDoc(fd);
 
 
@@ -214,11 +213,8 @@
         KrillIndex ki = new KrillIndex();
 
         FieldDocument fd = new FieldDocument();
-        fd.addTV(
-                "base",
-                "111111ccc222222fff333333iiijjj",
-                "[(0-3)s:a|_0$<i>0<i>3]"
-                        + "[(3-6)s:b|_1$<i>3<i>6]"
+        fd.addTV("base", "111111ccc222222fff333333iiijjj",
+                "[(0-3)s:a|_0$<i>0<i>3]" + "[(3-6)s:b|_1$<i>3<i>6]"
                         + "[(6-9)s:c|_2$<i>6<i>9]"
                         + "[(9-12)s:d|_3$<i>9<i>12|<>:a$<b>64<i>9<i>15<i>4<b>0]"
                         + "[(12-15)s:e|_4$<i>12<i>15]"
@@ -239,10 +235,10 @@
         Result kr = ki.search(sq, 0, (short) 15, false, (short) 3, false,
                 (short) 3);
 
-        assertEquals("... ccc[[222222]]fff ...", kr.getMatch(0)
-                .getSnippetBrackets());
-        assertEquals("... fff[[333333]]iii ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("... ccc[[222222]]fff ...",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("... fff[[333333]]iii ...",
+                kr.getMatch(1).getSnippetBrackets());
     };
 
 
@@ -251,12 +247,9 @@
         KrillIndex ki = new KrillIndex();
 
         FieldDocument fd = new FieldDocument();
-        fd.addTV(
-                "base",
-                "111111ccc222222fff333333iiijjj",
+        fd.addTV("base", "111111ccc222222fff333333iiijjj",
                 "[(0-3)s:a|_0$<i>0<i>3|<>:a$<b>64<i>0<i>6<i>1<b>0]"
-                        + "[(3-6)s:b|_1$<i>3<i>6]"
-                        + "[(6-9)s:c|_2$<i>6<i>9]"
+                        + "[(3-6)s:b|_1$<i>3<i>6]" + "[(6-9)s:c|_2$<i>6<i>9]"
                         + "[(9-12)s:d|_3$<i>9<i>12|<>:a$<b>64<i>9<i>15<i>4<b>0]"
                         + "[(12-15)s:e|_4$<i>12<i>15]"
                         + "[(15-18)s:f|_5$<i>15<i>18]"
@@ -277,10 +270,10 @@
                 (short) 3);
 
         assertEquals("[[111111]]ccc ...", kr.getMatch(0).getSnippetBrackets());
-        assertEquals("... ccc[[222222]]fff ...", kr.getMatch(1)
-                .getSnippetBrackets());
-        assertEquals("... fff[[333333]]iii ...", kr.getMatch(2)
-                .getSnippetBrackets());
+        assertEquals("... ccc[[222222]]fff ...",
+                kr.getMatch(1).getSnippetBrackets());
+        assertEquals("... fff[[333333]]iii ...",
+                kr.getMatch(2).getSnippetBrackets());
     };
 
 
@@ -307,10 +300,11 @@
         ki.addDoc(fd);
 
         fd = new FieldDocument();
-        fd.addTV("base", "x  y  z  h  ", "[(0-3)s:x|_0$<i>0<i>3]" + // 1
-                "[(3-6)s:y|_1$<i>3<i>6]" + // 2
-                "[(6-9)s:z|_2$<i>6<i>9]" + // 3
-                "[(9-12)s:h|_3$<i>9<i>12]"); // 4
+        fd.addTV("base", "x  y  z  h  ",
+                "[(0-3)s:x|_0$<i>0<i>3]" + // 1
+                        "[(3-6)s:y|_1$<i>3<i>6]" + // 2
+                        "[(6-9)s:z|_2$<i>6<i>9]" + // 3
+                        "[(9-12)s:h|_3$<i>9<i>12]"); // 4
         ki.addDoc(fd);
 
         // Here is a larger offset than expected
@@ -340,10 +334,11 @@
         ki.addDoc(fd);
 
         fd = new FieldDocument();
-        fd.addTV("base", "x  y  z  h  ", "[(0-3)s:x|_0$<i>0<i>3]" + // 1
-                "[(3-6)s:y|_1$<i>3<i>6]" + // 2
-                "[(6-9)s:z|_2$<i>6<i>9]" + // 3
-                "[(9-12)s:h|_3$<i>9<i>12]"); // 4
+        fd.addTV("base", "x  y  z  h  ",
+                "[(0-3)s:x|_0$<i>0<i>3]" + // 1
+                        "[(3-6)s:y|_1$<i>3<i>6]" + // 2
+                        "[(6-9)s:z|_2$<i>6<i>9]" + // 3
+                        "[(9-12)s:h|_3$<i>9<i>12]"); // 4
         ki.addDoc(fd);
 
         // Save documents
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java b/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
index a570e93..512535d 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestFieldDocument.java
@@ -84,27 +84,20 @@
     @Test
     public void indexExample2 () throws Exception {
 
-        String json = new String(
-                "{"
-                        + "  \"fields\" : ["
-                        + "    { "
-                        + "      \"primaryData\" : \"abc\""
-                        + "    },"
-                        + "    {"
-                        + "      \"name\" : \"tokens\","
-                        + "      \"data\" : ["
-                        + "         [ \"s:a\", \"i:a\", \"_0$<i>0<i>1\", \"-:t$<i>3\"],"
-                        + "         [ \"s:b\", \"i:b\", \"_1$<i>1<i>2\" ],"
-                        + "         [ \"s:c\", \"i:c\", \"_2$<i>2<i>3\" ]"
-                        + "      ]" + "    }" + "  ],"
-                        + "  \"corpusID\"  : \"WPD\","
-                        + "  \"ID\"        : \"WPD-AAA-00001\","
-                        + "  \"textClass\" : \"music entertainment\","
-                        + "  \"author\"    : \"Peter Frankenfeld\","
-                        + "  \"pubDate\"   : 20130617,"
-                        + "  \"title\"     : \"Wikipedia\","
-                        + "  \"subTitle\"  : \"Die freie Enzyklopädie\","
-                        + "  \"pubPlace\"  : \"Bochum\"" + "}");
+        String json = new String("{" + "  \"fields\" : [" + "    { "
+                + "      \"primaryData\" : \"abc\"" + "    }," + "    {"
+                + "      \"name\" : \"tokens\"," + "      \"data\" : ["
+                + "         [ \"s:a\", \"i:a\", \"_0$<i>0<i>1\", \"-:t$<i>3\"],"
+                + "         [ \"s:b\", \"i:b\", \"_1$<i>1<i>2\" ],"
+                + "         [ \"s:c\", \"i:c\", \"_2$<i>2<i>3\" ]" + "      ]"
+                + "    }" + "  ]," + "  \"corpusID\"  : \"WPD\","
+                + "  \"ID\"        : \"WPD-AAA-00001\","
+                + "  \"textClass\" : \"music entertainment\","
+                + "  \"author\"    : \"Peter Frankenfeld\","
+                + "  \"pubDate\"   : 20130617,"
+                + "  \"title\"     : \"Wikipedia\","
+                + "  \"subTitle\"  : \"Die freie Enzyklopädie\","
+                + "  \"pubPlace\"  : \"Bochum\"" + "}");
 
         KrillIndex ki = new KrillIndex();
         FieldDocument fd = ki.addDoc(json);
@@ -122,8 +115,8 @@
         assertEquals(fd.getPubDate().toDisplay(), "2013-06-17");
 
         QueryBuilder kq = new QueryBuilder("tokens");
-        Result kr = ki.search((SpanQuery) kq.seq(kq._(3, kq.seg("s:b")))
-                .toQuery());
+        Result kr = ki
+                .search((SpanQuery) kq.seq(kq._(3, kq.seg("s:b"))).toQuery());
 
         Match km = kr.getMatch(0);
 
@@ -164,11 +157,8 @@
         // Start creating query
         // within(<s>, {1: {2: [mate/p=ADJA & mate/m=number:sg]}[opennlp/p=NN & tt/p=NN]})
 
-        ks = new Krill(kq.within(
-                kq.tag("base/s:s"),
-                kq._(1,
-                        kq.seq(kq.seg("mate/p:ADJA")).append(
-                                kq.seg("opennlp/p:NN")))));
+        ks = new Krill(kq.within(kq.tag("base/s:s"), kq._(1,
+                kq.seq(kq.seg("mate/p:ADJA")).append(kq.seg("opennlp/p:NN")))));
 
         KrillMeta meta = ks.getMeta();
         meta.setCount(1);
@@ -199,9 +189,10 @@
         };
         ki.commit();
 
-        String jsonPath = URLDecoder.decode(getClass().getResource("/queries/bsp18.jsonld")
-                .getFile(),"UTF-8");
-        
+        String jsonPath = URLDecoder.decode(
+                getClass().getResource("/queries/bsp18.jsonld").getFile(),
+                "UTF-8");
+
         // {1:der} \w0:5 nicht
         SpanQueryWrapper sqwi = jsonQuery(jsonPath);
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestFocusIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestFocusIndex.java
index b835df1..9228c78 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestFocusIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestFocusIndex.java
@@ -28,14 +28,15 @@
 
     /**
      * Check Skipto focus spans
-     * */
+     */
     @Test
     public void testCase12 () throws IOException {
         ki.addDoc(TestRelationIndex.createFieldDoc0());
         ki.addDoc(TestRelationIndex.createFieldDoc1());
         ki.commit();
-        SpanRelationQuery sq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", ">:xip/syntax-dep_rel")), true);
+        SpanRelationQuery sq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", ">:xip/syntax-dep_rel")),
+                true);
         sq.setSourceClass((byte) 1);
 
         SpanFocusQuery sfq = new SpanFocusQuery(sq, (byte) 1);
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestIndex.java
index 9b08699..7aff713 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestIndex.java
@@ -232,24 +232,27 @@
 
         // textClass
         // All texts of text class "news"
-        assertEquals(2, searcher.search(new TermQuery(new Term("textClass",
-                "news")), 10).totalHits);
+        assertEquals(2,
+                searcher.search(new TermQuery(new Term("textClass", "news")),
+                        10).totalHits);
 
         // textClass
         // All texts of text class "sports"
-        assertEquals(2, searcher.search(new TermQuery(new Term("textClass",
-                "sports")), 10).totalHits);
+        assertEquals(2,
+                searcher.search(new TermQuery(new Term("textClass", "sports")),
+                        10).totalHits);
 
         // TextIndex
         // All docs containing "l:nehmen"
-        assertEquals(1, searcher.search(new TermQuery(new Term("text",
-                "l:nehmen")), 10).totalHits);
+        assertEquals(1,
+                searcher.search(new TermQuery(new Term("text", "l:nehmen")),
+                        10).totalHits);
 
         // TextIndex
         // All docs containing "s:den"
-        assertEquals(
-                2,
-                searcher.search(new TermQuery(new Term("text", "s:den")), 10).totalHits);
+        assertEquals(2,
+                searcher.search(new TermQuery(new Term("text", "s:den")),
+                        10).totalHits);
 
         /*
         assertEquals(3,
@@ -311,8 +314,8 @@
         assertEquals(2, searcher.search(srquery, 10).totalHits);
 
         ssrquery = new SpanRegexQueryWrapper("text", "s:e.", true);
-        assertEquals("SpanMultiTermQueryWrapper(text:/i:e./)", ssrquery
-                .toQuery().toString());
+        assertEquals("SpanMultiTermQueryWrapper(text:/i:e./)",
+                ssrquery.toQuery().toString());
         assertEquals(2, searcher.search(ssrquery.toQuery(), 10).totalHits);
 
         // All docs containing "ng"/x (Angst) (2x)
@@ -325,60 +328,72 @@
 
         // vor Angst
         // [orth=vor][orth=Angst]
-        SpanNearQuery snquery = new SpanNearQuery(new SpanQuery[] {
-                new SpanTermQuery(new Term("text", "s:vor")),
-                new SpanTermQuery(new Term("text", "s:Angst")) }, 1, true);
+        SpanNearQuery snquery = new SpanNearQuery(
+                new SpanQuery[] { new SpanTermQuery(new Term("text", "s:vor")),
+                        new SpanTermQuery(new Term("text", "s:Angst")) },
+                1, true);
         assertEquals(1, searcher.search(snquery, 10).totalHits);
 
         // Spannearquery [p:VVFIN][]{,5}[m:nom:sg:fem]
-        snquery = new SpanNearQuery(new SpanQuery[] {
-                new SpanTermQuery(new Term("text", "p:VVFIN")),
-                new SpanSegmentQueryWrapper("text", "m:c:nom", "m:n:sg",
-                        "m:g:fem").toQuery() }, 5,     // slop
+        snquery = new SpanNearQuery(
+                new SpanQuery[] {
+                        new SpanTermQuery(new Term("text", "p:VVFIN")),
+                        new SpanSegmentQueryWrapper("text", "m:c:nom", "m:n:sg",
+                                "m:g:fem").toQuery() },
+                5,     // slop
                 true   // inOrder
-                     // Possible: CollectPayloads
+            // Possible: CollectPayloads
         );
         assertEquals(1, searcher.search(snquery, 10).totalHits);
 
 
         // Spannearquery [p:VVFIN][m:acc:sg:masc]
-        snquery = new SpanNearQuery(new SpanQuery[] {
-                new SpanTermQuery(new Term("text", "p:VVFIN")),
-                new SpanNearQuery(new SpanQuery[] {
-                        new SpanTermQuery(new Term("text", "m:c:acc")),
-                        new SpanNearQuery(
-                                new SpanQuery[] {
-                                        new SpanTermQuery(new Term("text",
-                                                "m:n:sg")),
-                                        new SpanTermQuery(new Term("text",
-                                                "m:g:masc")) }, -1, false) },
+        snquery = new SpanNearQuery(new SpanQuery[] { new SpanTermQuery(
+                new Term("text", "p:VVFIN")),
+                new SpanNearQuery(
+                        new SpanQuery[] {
+                                new SpanTermQuery(new Term("text", "m:c:acc")),
+                                new SpanNearQuery(
+                                        new SpanQuery[] {
+                                                new SpanTermQuery(new Term(
+                                                        "text", "m:n:sg")),
+                                                new SpanTermQuery(new Term(
+                                                        "text", "m:g:masc")) },
+                                        -1, false) },
                         -1,     // slop
                         false   // inOrder
                 // Possible: CollectPayloads
                 )
-        // new SpanTermQuery(new Term("text", "m:-acc:--sg:masc"))
-                }, 0,     // slop
+                // new SpanTermQuery(new Term("text", "m:-acc:--sg:masc"))
+        }, 0,     // slop
                 true   // inOrder
-                     // Possible: CollectPayloads
+            // Possible: CollectPayloads
         );
         assertEquals(1, searcher.search(snquery, 10).totalHits);
 
 
         // Spannearquery [p:VVFIN|m:3:sg:past:ind]
         // Exact match!
-        snquery = new SpanNearQuery(new SpanQuery[] {
-                new SpanTermQuery(new Term("text", "p:VVFIN")),
-                new SpanNearQuery(new SpanQuery[] {
-                        new SpanTermQuery(new Term("text", "m:p:3")),
+        snquery = new SpanNearQuery(
+                new SpanQuery[] {
+                        new SpanTermQuery(new Term("text", "p:VVFIN")),
                         new SpanNearQuery(new SpanQuery[] {
-                                new SpanTermQuery(new Term("text", "m:n:sg")),
+                                new SpanTermQuery(new Term("text", "m:p:3")),
                                 new SpanNearQuery(new SpanQuery[] {
-                                        new SpanTermQuery(new Term("text",
-                                                "m:t:past")),
-                                        new SpanTermQuery(new Term("text",
-                                                "m:m:ind")), }, -1, false) },
-                                -1, false) }, -1, false) },
-        // new SpanTermQuery(new Term("text", "m:---3:--sg:past:-ind"))
+                                        new SpanTermQuery(
+                                                new Term("text", "m:n:sg")),
+                                        new SpanNearQuery(
+                                                new SpanQuery[] {
+                                                        new SpanTermQuery(
+                                                                new Term("text",
+                                                                        "m:t:past")),
+                                                        new SpanTermQuery(
+                                                                new Term("text",
+                                                                        "m:m:ind")), },
+                                                -1, false) },
+                                        -1, false) },
+                                -1, false) },
+                // new SpanTermQuery(new Term("text", "m:---3:--sg:past:-ind"))
                 -1,     // slop
                 false   // inOrder
         // Possible: CollectPayloads
@@ -389,12 +404,14 @@
         // Spannearquery [p:VVFIN & m:3:sg:past:ind]
         // Exact match!
         // Maybe it IS equal
-        snquery = new SpanNearQuery(new SpanQuery[] {
-                new SpanTermQuery(new Term("text", "p:VVFIN")),
-                new SpanTermQuery(new Term("text", "m:p:3")),
-                new SpanTermQuery(new Term("text", "m:n:sg")),
-                new SpanTermQuery(new Term("text", "m:t:past")),
-                new SpanTermQuery(new Term("text", "m:m:ind")), }, -1,     // slop
+        snquery = new SpanNearQuery(
+                new SpanQuery[] {
+                        new SpanTermQuery(new Term("text", "p:VVFIN")),
+                        new SpanTermQuery(new Term("text", "m:p:3")),
+                        new SpanTermQuery(new Term("text", "m:n:sg")),
+                        new SpanTermQuery(new Term("text", "m:t:past")),
+                        new SpanTermQuery(new Term("text", "m:m:ind")), },
+                -1,     // slop
                 false   // inOrder
         // Possible: CollectPayloads
         );
@@ -421,12 +438,14 @@
         */
 
         // Spannearquery [p:VVFIN][]{,5}[m:nom:sg:fem]
-        snquery = new SpanNearQuery(new SpanQuery[] {
-                new SpanTermQuery(new Term("text", "p:VVFIN")),
-                new SpanSegmentQueryWrapper("text", "m:c:nom", "m:n:sg",
-                        "m:g:fem").toQuery() }, 5,     // slop
+        snquery = new SpanNearQuery(
+                new SpanQuery[] {
+                        new SpanTermQuery(new Term("text", "p:VVFIN")),
+                        new SpanSegmentQueryWrapper("text", "m:c:nom", "m:n:sg",
+                                "m:g:fem").toQuery() },
+                5,     // slop
                 true   // inOrder
-                     // Possible: CollectPayloads
+            // Possible: CollectPayloads
         );
         assertEquals(1, searcher.search(snquery, 10).totalHits);
 
@@ -445,41 +464,40 @@
         assertEquals(2, searcher.search(snqquery, 10).totalHits);
 
         // [p = NN & (m:c: = dat | m:c = acc)]
-        snquery = new SpanNearQuery(new SpanQuery[] {
-                new SpanTermQuery(new Term("text", "p:NN")),
-                new SpanOrQuery(new SpanTermQuery(new Term("text", "m:c:nom")),
-                        new SpanTermQuery(new Term("text", "m:c:acc"))) }, -1,
-                false);
+        snquery = new SpanNearQuery(
+                new SpanQuery[] { new SpanTermQuery(new Term("text", "p:NN")),
+                        new SpanOrQuery(
+                                new SpanTermQuery(new Term("text", "m:c:nom")),
+                                new SpanTermQuery(
+                                        new Term("text", "m:c:acc"))) },
+                -1, false);
 
         assertEquals(2, searcher.search(snqquery, 10).totalHits);
 
         // [p = NN & !(m:c: = nom | m:c = acc)]
-        snqquery = new SpanNotQuery(
-                new SpanTermQuery(new Term("text", "p:NN")), new SpanOrQuery(
-                        new SpanTermQuery(new Term("text", "m:c:nom")),
+        snqquery = new SpanNotQuery(new SpanTermQuery(new Term("text", "p:NN")),
+                new SpanOrQuery(new SpanTermQuery(new Term("text", "m:c:nom")),
                         new SpanTermQuery(new Term("text", "m:c:acc"))));
         assertEquals(1, searcher.search(snqquery, 10).totalHits);
 
         // [p = NN & !(m:c = nom)]
-        snqquery = new SpanNotQuery(
-                new SpanTermQuery(new Term("text", "p:NN")), new SpanTermQuery(
-                        new Term("text", "m:c:nom")));
+        snqquery = new SpanNotQuery(new SpanTermQuery(new Term("text", "p:NN")),
+                new SpanTermQuery(new Term("text", "m:c:nom")));
         assertEquals(3, searcher.search(snqquery, 10).totalHits);
 
         // [p=NN & !(m:c = acc)]
-        snqquery = new SpanNotQuery(
-                new SpanTermQuery(new Term("text", "p:NN")), new SpanTermQuery(
-                        new Term("text", "m:c:acc")));
+        snqquery = new SpanNotQuery(new SpanTermQuery(new Term("text", "p:NN")),
+                new SpanTermQuery(new Term("text", "m:c:acc")));
         assertEquals(2, searcher.search(snqquery, 10).totalHits);
 
         // [p=PPER][][p=ART]
         snquery = new SpanNearQuery(
-                new SpanQuery[] {
-                        new SpanTermQuery(new Term("text", "p:PPER")),
+                new SpanQuery[] { new SpanTermQuery(new Term("text", "p:PPER")),
                         new SpanNearQuery(new SpanQuery[] {
                                 new SpanTermQuery(new Term("text", "T")),
                                 new SpanTermQuery(new Term("text", "p:ART")) },
-                                0, true), }, 0, true);
+                                0, true), },
+                0, true);
         assertEquals(1, searcher.search(snquery, 10).totalHits);
 
 
@@ -498,11 +516,14 @@
 
 
         // [][][p:VAFIN]
-        snquery = new SpanNearQuery(new SpanQuery[] {
-                new SpanNearQuery(new SpanQuery[] {
-                        new SpanTermQuery(new Term("text", "T")),
-                        new SpanTermQuery(new Term("text", "T")) }, 0, true),
-                new SpanTermQuery(new Term("text", "p:VAFIN")) }, 0, true);
+        snquery = new SpanNearQuery(
+                new SpanQuery[] {
+                        new SpanNearQuery(new SpanQuery[] {
+                                new SpanTermQuery(new Term("text", "T")),
+                                new SpanTermQuery(new Term("text", "T")) }, 0,
+                                true),
+                        new SpanTermQuery(new Term("text", "p:VAFIN")) },
+                0, true);
         assertEquals(1, searcher.search(snquery, 10).totalHits);
 
         /*
@@ -540,8 +561,8 @@
                                 new SpanTermQuery(new Term("text", "T")),
                                 new SpanTermQuery(new Term("text", "T")) }, 0,
                                 true, false),
-                        new SpanTermQuery(new Term("text", "p:VAFIN")) }, 0,
-                true, false);
+                        new SpanTermQuery(new Term("text", "p:VAFIN")) },
+                0, true, false);
         assertEquals(1, searcher.search(snquery, 10).totalHits);
 
         payloadString = new StringBuilder();
@@ -567,19 +588,19 @@
         // ([e:s:<][]*[T] | [T & e:s:<]) [T] ([p:VAFIN & e:s:>] | [T][]*[e:s:>]
 
         /*
-
+        
         SpanSegmentWithinQuery ssequery = new SpanSegmentWithinQuery(
             "text","s", new SpanSegmentSequenceQuery("text", "T", "T", "p:VAFIN")
             );
         assertEquals(0, searcher.search(ssequery.toQuery(), 10).totalHits);
-
+        
         payloadString = new StringBuilder();
         termContexts = new HashMap<>();
         for (LeafReaderContext atomic : reader.leaves()) {
             Bits bitset = atomic.reader().getLiveDocs();
             // Spans spans = NearSpansOrdered();
             Spans spans = ssequery.toQuery().getSpans(atomic, bitset, termContexts);
-
+        
             while (spans.next()) {
         	int docid = atomic.docBase + spans.doc();
         	for (byte[] payload : spans.getPayload()) {
@@ -590,21 +611,21 @@
             };
         };
         assertEquals(0, payloadString.length(), 1);
-
+        
         ssequery = new SpanSegmentWithinQuery(
             "text","s", new SpanSegmentSequenceQuery("text", "T", "p:VAFIN")
             );
-
+        
         assertEquals("for " + ssequery.toQuery(),
         	     1, searcher.search(ssequery.toQuery(), 10).totalHits);
-
+        
         payloadString = new StringBuilder();
         termContexts = new HashMap<>();
         for (LeafReaderContext atomic : reader.leaves()) {
             Bits bitset = atomic.reader().getLiveDocs();
             // Spans spans = NearSpansOrdered();
             Spans spans = ssequery.toQuery().getSpans(atomic, bitset, termContexts);
-
+        
             while (spans.next()) {
         	int docid = atomic.docBase + spans.doc();
         	for (byte[] payload : spans.getPayload()) {
@@ -616,7 +637,7 @@
             };
         };
         assertEquals(20, payloadString.length());
-
+        
         */
 
         // --------------------______>
@@ -630,7 +651,7 @@
         for (int i = 0; i < topDocs.scoreDocs.length; i++) {
           while (spans.next()) {
             Collection<byte[]> payloads = spans.getPayload();
-
+        
             for (final byte [] payload : payloads) {
               payloadSet.add(new String(payload, "UTF-8"));
             }
@@ -644,7 +665,7 @@
         IndexReader reader = writer.getReader();
         writer.close();
         IndexSearcher searcher = newSearcher(reader);
-
+        
         PayloadSpanUtil psu = new PayloadSpanUtil(searcher.getTopReaderContext());
         
         Collection<byte[]> payloads = psu.getPayloadsForQuery(new TermQuery(new Term(PayloadHelper.FIELD, "rr")));
@@ -671,7 +692,7 @@
         Spans luceneSpans;
         Bits bitset = atomic.reader().getLiveDocs();
         for (byte[] payload : luceneSpans.getPayload())
-
+        
         /* Iterate over all matching documents */
         /*
             while (luceneSpans.next() && total < config.getMaxhits()) {
@@ -681,7 +702,7 @@
         	String docname = search.retrieveDocname(docid,
         					querycontainer.getFoundry());
         					total++;
-
+        
         	for (byte[] payload : luceneSpans.getPayload())
         */
         /* retrieve payload for current matching span */
@@ -724,7 +745,7 @@
 
         /*
         SpanNearQuery poquery = new SpanNearQuery(
-
+        
         );
         */
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestKrillIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestKrillIndex.java
index c20434b..024ea72 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestKrillIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestKrillIndex.java
@@ -48,9 +48,8 @@
         fd.addInt("zahl3", "059");
         fd.addInt("UID", 1);
         fd.addText("teaser", "Das ist der Name der Rose");
-        fd.addTV("base", "ich bau",
-                "[(0-3)s:ich|l:ich|p:PPER|-:sentences$<i>2]"
-                        + "[(4-7)s:bau|l:bauen|p:VVFIN]");
+        fd.addTV("base", "ich bau", "[(0-3)s:ich|l:ich|p:PPER|-:sentences$<i>2]"
+                + "[(4-7)s:bau|l:bauen|p:VVFIN]");
         ki.addDoc(fd);
 
         fd = new FieldDocument();
@@ -136,10 +135,11 @@
 
         // These values are canonically equivalent
         // But indexed as byte sequences
-        fd.addTV("base", new String("ju" + "\u006E" + "\u0303" + "o") + " "
-                + new String("ju" + "\u00F1" + "o"), "[(0-5)s:ju" + "\u006E"
-                + "\u0303" + "o|_0$<i>0<i>5|-:t$<i>2]" + "[(6-10)s:ju"
-                + "\u00F1" + "o|_1$<i>6<i>10]");
+        fd.addTV("base",
+                new String("ju" + "\u006E" + "\u0303" + "o") + " "
+                        + new String("ju" + "\u00F1" + "o"),
+                "[(0-5)s:ju" + "\u006E" + "\u0303" + "o|_0$<i>0<i>5|-:t$<i>2]"
+                        + "[(6-10)s:ju" + "\u00F1" + "o|_1$<i>6<i>10]");
         ki.addDoc(fd);
         ki.commit();
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestMatchCollector.java b/src/test/java/de/ids_mannheim/korap/index/TestMatchCollector.java
index 0c85b64..7fe7c37 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMatchCollector.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMatchCollector.java
@@ -41,12 +41,12 @@
         fd = new FieldDocument();
         fd.addString("ID", "doc-2");
         fd.addString("UID", "2");
-        fd.addTV("base", "bcbabd", "[(0-1)s:b|i:b|_1$<i>0<i>1]"
-                + "[(1-2)s:c|i:c|s:b|_2$<i>1<i>2]"
-                + "[(2-3)s:b|i:b|_3$<i>2<i>3|<>:e#2-4$<i>4]"
-                + "[(3-4)s:a|i:a|_4$<i>3<i>4|<>:e#3-5$<i>5|<>:e2#3-5$<i>5]"
-                + "[(4-5)s:b|i:b|s:c|_5$<i>4<i>5]"
-                + "[(5-6)s:d|i:d|_6$<i>5<i>6|<>:e2#5-6$<i>6]");
+        fd.addTV("base", "bcbabd",
+                "[(0-1)s:b|i:b|_1$<i>0<i>1]" + "[(1-2)s:c|i:c|s:b|_2$<i>1<i>2]"
+                        + "[(2-3)s:b|i:b|_3$<i>2<i>3|<>:e#2-4$<i>4]"
+                        + "[(3-4)s:a|i:a|_4$<i>3<i>4|<>:e#3-5$<i>5|<>:e2#3-5$<i>5]"
+                        + "[(4-5)s:b|i:b|s:c|_5$<i>4<i>5]"
+                        + "[(5-6)s:d|i:d|_6$<i>5<i>6|<>:e2#5-6$<i>6]");
         ki.addDoc(fd);
 
         ki.commit();
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java b/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
index 072a633..e53ad87 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMatchIdentifier.java
@@ -67,7 +67,8 @@
         id = new MatchIdentifier("match-c1!d1-p4-20(5)7-8(-2)9-10");
         assertEquals(id.toString(), "match-c1!d1-p4-20(5)7-8");
 
-        id = new MatchIdentifier("match-c1!d1-p4-20(5)7-8(-2)9-10(2)3-4(3)-5-6");
+        id = new MatchIdentifier(
+                "match-c1!d1-p4-20(5)7-8(-2)9-10(2)3-4(3)-5-6");
         assertEquals(id.toString(), "match-c1!d1-p4-20(5)7-8(2)3-4");
 
         id = new MatchIdentifier(
@@ -117,8 +118,8 @@
         ki.commit();
 
         QueryBuilder kq = new QueryBuilder("tokens");
-        Krill ks = new Krill(kq._(2,
-                kq.seq(kq.seg("s:b")).append(kq._(kq.seg("s:a")))));
+        Krill ks = new Krill(
+                kq._(2, kq.seq(kq.seg("s:b")).append(kq._(kq.seg("s:a")))));
         Result kr = ki.search(ks);
 
         assertEquals("totalResults", kr.getTotalResults(), 1);
@@ -149,11 +150,12 @@
 
         assertEquals("ID (0)", "match-c1!d1-p7-9(0)8-8(2)7-8", km.getID());
 
-        km = ki.getMatchInfo("match-c1!d1-p7-9(0)8-8(2)7-8", "tokens", "f",
-                "m", false, false);
+        km = ki.getMatchInfo("match-c1!d1-p7-9(0)8-8(2)7-8", "tokens", "f", "m",
+                false, false);
 
         assertEquals("SnippetBrackets (1)",
-                "... [[{f/m:acht:b}{f/m:neun:a}]] ...", km.getSnippetBrackets());
+                "... [[{f/m:acht:b}{f/m:neun:a}]] ...",
+                km.getSnippetBrackets());
 
 
         km = ki.getMatchInfo("match-c1!d1-p7-9(0)8-8(2)7-8", "tokens", "f",
@@ -162,15 +164,15 @@
                 "... [[{f/m:acht:{f/y:eight:b}}{f/m:neun:{f/y:nine:a}}]] ...",
                 km.getSnippetBrackets());
 
-        km = ki.getMatchInfo("match-c1!d1-p7-9(0)8-8(2)7-8", "tokens", "f",
-                "m", false, true);
+        km = ki.getMatchInfo("match-c1!d1-p7-9(0)8-8(2)7-8", "tokens", "f", "m",
+                false, true);
 
         assertEquals("SnippetBrackets (2)",
                 "... [[{2:{f/m:acht:b}{{f/m:neun:a}}}]] ...",
                 km.getSnippetBrackets());
 
-        km = ki.getMatchInfo("match-c1!d1-p7-9(4)8-8(2)7-8", "tokens", "f",
-                "m", false, true);
+        km = ki.getMatchInfo("match-c1!d1-p7-9(4)8-8(2)7-8", "tokens", "f", "m",
+                false, true);
 
         assertEquals("SnippetBrackets (3)",
                 "... [[{2:{f/m:acht:b}{4:{f/m:neun:a}}}]] ...",
@@ -179,22 +181,22 @@
         km = ki.getMatchInfo("match-c1!d1-p7-9(4)8-8(2)7-8", "tokens", "f",
                 null, false, true);
 
-        assertEquals(
-                "SnippetBrackets (4)",
+        assertEquals("SnippetBrackets (4)",
                 "... [[{2:{f/m:acht:{f/y:eight:b}}{4:{f/m:neun:{f/y:nine:a}}}}]] ...",
                 km.getSnippetBrackets());
 
-        assertEquals("SnippetHTML (4)", "<span class=\"context-left\">"
-                + "<span class=\"more\">" + "</span>" + "</span>"
-                + "<span class=\"match\">" + "<mark>"
-                + "<mark class=\"class-2 level-0\">"
-                + "<span title=\"f/m:acht\">" + "<span title=\"f/y:eight\">"
-                + "b" + "</span>" + "</span>"
-                + "<mark class=\"class-4 level-1\">"
-                + "<span title=\"f/m:neun\">" + "<span title=\"f/y:nine\">"
-                + "a" + "</span>" + "</span>" + "</mark>" + "</mark>"
-                + "</mark>" + "</span>" + "<span class=\"context-right\">"
-                + "<span class=\"more\">" + "</span>" + "</span>",
+        assertEquals("SnippetHTML (4)",
+                "<span class=\"context-left\">" + "<span class=\"more\">"
+                        + "</span>" + "</span>" + "<span class=\"match\">"
+                        + "<mark>" + "<mark class=\"class-2 level-0\">"
+                        + "<span title=\"f/m:acht\">"
+                        + "<span title=\"f/y:eight\">" + "b" + "</span>"
+                        + "</span>" + "<mark class=\"class-4 level-1\">"
+                        + "<span title=\"f/m:neun\">"
+                        + "<span title=\"f/y:nine\">" + "a" + "</span>"
+                        + "</span>" + "</mark>" + "</mark>" + "</mark>"
+                        + "</span>" + "<span class=\"context-right\">"
+                        + "<span class=\"more\">" + "</span>" + "</span>",
                 km.getSnippetHTML());
 
         JsonNode res = mapper.readTree(km.toJsonString());
@@ -203,8 +205,8 @@
         assertTrue(res.at("/endMore").asBoolean());
         assertEquals("c1", res.at("/corpusID").asText());
         assertEquals("d1", res.at("/docID").asText());
-        assertEquals("match-c1!d1-p7-9(4)8-8(2)7-8", res.at("/matchID")
-                .asText());
+        assertEquals("match-c1!d1-p7-9(4)8-8(2)7-8",
+                res.at("/matchID").asText());
         assertTrue(res.at("/pubDate").isMissingNode());
     };
 
@@ -267,8 +269,8 @@
         ki.addDoc(getClass().getResourceAsStream("/goe/AGX-00002.json"), false);
         ki.commit();
 
-        Match km = ki.getMatchInfo("match-GOE!GOE_AGX.00002-p210-211",
-                "tokens", true, (String) null, (String) null, true, true, true);
+        Match km = ki.getMatchInfo("match-GOE!GOE_AGX.00002-p210-211", "tokens",
+                true, (String) null, (String) null, true, true, true);
 
         JsonNode res = mapper.readTree(km.toJsonString());
         assertEquals("tokens", res.at("/field").asText());
@@ -294,8 +296,7 @@
                 null, null, true, false);
 
 
-        assertEquals(
-                "SnippetBrackets (1)",
+        assertEquals("SnippetBrackets (1)",
                 "... [[{f/m:acht:{f/y:eight:{it/is:8:{x/o:achtens:b}}}}{f/m:neun:{f/y:nine:{it/is:9:{x/o:neuntens:a}}}}]] ...",
                 km.getSnippetBrackets());
     };
@@ -311,8 +312,7 @@
                 null, null, true, false);
 
 
-        assertEquals(
-                "SnippetBrackets (1)",
+        assertEquals("SnippetBrackets (1)",
                 "... [[{x/tag:{f/m:acht:{f/y:eight:{it/is:8:{x/o:achtens:b}}}}{f/m:neun:{f/y:nine:{it/is:9:{x/o:neuntens:a}}}}{f/m:zehn:{f/y:ten:{it/is:10:{x/o:zehntens:c}}}}}]]",
                 km.getSnippetBrackets());
     };
@@ -328,15 +328,14 @@
                 null, null, true, true);
 
 
-        assertEquals(
-                "SnippetBrackets (1)",
+        assertEquals("SnippetBrackets (1)",
                 "... [[{x/tag:{2:{f/m:acht:{f/y:eight:{it/is:8:{x/o:achtens:b}}}}{4:{f/m:neun:{f/y:nine:{it/is:9:{x/o:neuntens:a}}}}}}{f/m:zehn:{f/y:ten:{it/is:10:{x/o:zehntens:c}}}}}]]",
                 km.getSnippetBrackets());
 
         assertEquals("SnippetHTML (1)", "<span class=\"context-left\">"
                 + "<span class=\"more\">" + "</span>" + "</span>"
-                + "<span class=\"match\">" + "<mark>"
-                + "<span title=\"x/tag\">" + "<mark class=\"class-2 level-0\">"
+                + "<span class=\"match\">" + "<mark>" + "<span title=\"x/tag\">"
+                + "<mark class=\"class-2 level-0\">"
                 + "<span title=\"f/m:acht\">" + "<span title=\"f/y:eight\">"
                 + "<span title=\"it/is:8\">" + "<span title=\"x/o:achtens\">"
                 + "b" + "</span>" + "</span>" + "</span>" + "</span>"
@@ -362,8 +361,7 @@
         Match km = ki.getMatchInfo("match-c1!d1-p0-5(4)8-8(2)7-8", "tokens",
                 "x", null, true, false);
 
-        assertEquals(
-                "SnippetBrackets (1)",
+        assertEquals("SnippetBrackets (1)",
                 "[[{x/rel:a>3:{x/o:erstens:a}}{x/o:zweitens:b}{x/o:drittens:c}{#3:{x/o:viertens:a}}{x/o:fünftens:b}]] ...",
                 km.getSnippetBrackets());
 
@@ -402,8 +400,8 @@
 
 
     @Test
-    public void indexExample7SentenceExpansion () throws IOException,
-            QueryException {
+    public void indexExample7SentenceExpansion ()
+            throws IOException, QueryException {
         KrillIndex ki = new KrillIndex();
         ki.addDoc(createSimpleFieldDoc());
         ki.addDoc(createSimpleFieldDoc2());
@@ -433,9 +431,8 @@
                 + "<span class=\"match\">" + "<span title=\"f/m:drei\">"
                 + "<span title=\"f/y:three\">" + "<span title=\"it/is:3\">"
                 + "<span title=\"x/o:drittens\">c</span>" + "</span>"
-                + "</span>" + "</span>" + "<mark>"
-                + "<span title=\"f/m:vier\">" + "<span title=\"f/y:four\">"
-                + "<span title=\"it/is:4\">"
+                + "</span>" + "</span>" + "<mark>" + "<span title=\"f/m:vier\">"
+                + "<span title=\"f/y:four\">" + "<span title=\"it/is:4\">"
                 + "<span title=\"x/o:viertens\">a</span>" + "</span>"
                 + "</span>" + "</span>" + "</mark>"
                 + "<span title=\"f/m:fuenf\">" + "<span title=\"f/y:five\">"
@@ -449,12 +446,12 @@
         /*
         km = ki.getMatchInfo("match-c1!d3-p3-4", "tokens", null, null, false,
                 false, true); // extendToSentence
-
+        
         assertEquals(
                 "[{f/m:drei:{f/y:three:{it/is:3:{x/o:drittens:cc}}}} {f/m:vier:{f/y:four:{it/is:4:{x/o:viertens:aa}}}} {f/m:fuenf:{f/y:five:{it/is:5:{x/o:fünftens:bb}}}}]",
                 km.getSnippetBrackets());
-
-
+        
+        
         km = ki.getMatchInfo("match-c1!d4-p4-6", "tokens", null, null, false,
                 false, true); // extendToSentence
         assertEquals(
@@ -465,7 +462,8 @@
 
 
     @Test
-    public void indexExample7Dependencies () throws IOException, QueryException {
+    public void indexExample7Dependencies ()
+            throws IOException, QueryException {
         KrillIndex ki = new KrillIndex();
         ki.addDoc(createSimpleFieldDoc2());
         ki.commit();
@@ -473,63 +471,46 @@
         Match km = ki.getMatchInfo("match-c1!d1-p0-4", "tokens", null, null,
                 true, true);
 
-        assertEquals(
-                "SnippetHTML (2)",
-                "<span class=\"context-left\">"
-                        + "</span>"
-                        + "<span class=\"match\">"
-                        + "<mark>"
-                        + "<span xlink:title=\"x/rel:a\" xlink:type=\"simple\" xlink:href=\"#word-c1!d1-p3\">"
-                        + "<span title=\"f/m:eins\">"
-                        + "<span title=\"f/y:one\">"
-                        + "<span title=\"it/is:1\">"
-                        + "<span title=\"x/o:erstens\">a</span>"
-                        + "</span>"
-                        + "</span>"
-                        + "</span>"
-                        + "</span>"
-                        + "<span xlink:title=\"x/rel:b\" xlink:type=\"simple\" xlink:href=\"#word-c1!d1-p3\">"
-                        + "<span title=\"f/m:zwei\">"
-                        + "<span title=\"f/y:two\">"
-                        + "<span title=\"it/is:2\">"
-                        + "<span title=\"x/o:zweitens\">b</span>" + "</span>"
-                        + "</span>" + "</span>" + "</span>"
-                        + "<span title=\"f/m:drei\">"
-                        + "<span title=\"f/y:three\">"
-                        + "<span title=\"it/is:3\">"
-                        + "<span title=\"x/o:drittens\">c</span>" + "</span>"
-                        + "</span>" + "</span>"
-                        + "<span xml:id=\"word-c1!d1-p3\">"
-                        + "<span title=\"f/m:vier\">"
-                        + "<span title=\"f/y:four\">"
-                        + "<span title=\"it/is:4\">"
-                        + "<span title=\"x/o:viertens\">a</span>" + "</span>"
-                        + "</span>" + "</span>" + "</span>" + "</mark>"
-                        + "</span>" + "<span class=\"context-right\">"
-                        + "<span class=\"more\">" + "</span>" + "</span>",
-                km.getSnippetHTML());
+        assertEquals("SnippetHTML (2)", "<span class=\"context-left\">"
+                + "</span>" + "<span class=\"match\">" + "<mark>"
+                + "<span xlink:title=\"x/rel:a\" xlink:type=\"simple\" xlink:href=\"#word-c1!d1-p3\">"
+                + "<span title=\"f/m:eins\">" + "<span title=\"f/y:one\">"
+                + "<span title=\"it/is:1\">"
+                + "<span title=\"x/o:erstens\">a</span>" + "</span>" + "</span>"
+                + "</span>" + "</span>"
+                + "<span xlink:title=\"x/rel:b\" xlink:type=\"simple\" xlink:href=\"#word-c1!d1-p3\">"
+                + "<span title=\"f/m:zwei\">" + "<span title=\"f/y:two\">"
+                + "<span title=\"it/is:2\">"
+                + "<span title=\"x/o:zweitens\">b</span>" + "</span>"
+                + "</span>" + "</span>" + "</span>"
+                + "<span title=\"f/m:drei\">" + "<span title=\"f/y:three\">"
+                + "<span title=\"it/is:3\">"
+                + "<span title=\"x/o:drittens\">c</span>" + "</span>"
+                + "</span>" + "</span>" + "<span xml:id=\"word-c1!d1-p3\">"
+                + "<span title=\"f/m:vier\">" + "<span title=\"f/y:four\">"
+                + "<span title=\"it/is:4\">"
+                + "<span title=\"x/o:viertens\">a</span>" + "</span>"
+                + "</span>" + "</span>" + "</span>" + "</mark>" + "</span>"
+                + "<span class=\"context-right\">" + "<span class=\"more\">"
+                + "</span>" + "</span>", km.getSnippetHTML());
     };
 
 
     @Test
-    public void indexExampleMultipleFoundries () throws IOException,
-            QueryException {
+    public void indexExampleMultipleFoundries ()
+            throws IOException, QueryException {
         KrillIndex ki = new KrillIndex();
         ki.addDoc(createSimpleFieldDoc4());
         ki.commit();
 
         Match km = ki.getMatchInfo("match-c1!d4-p3-9", "tokens", "f", "m",
                 false, false);
-        assertEquals(
-                "f:m info",
-                km.getSnippetBrackets(),
+        assertEquals("f:m info", km.getSnippetBrackets(),
                 "... [[{f/m:vier:a}{f/m:fuenf:b}{f/m:sechs:c}{f/m:sieben:a}{f/m:acht:b}{f/m:neun:a}]] ...");
 
         km = ki.getMatchInfo("match-c1!d4-p3-9", "tokens", "f", null, false,
                 false);
-        assertEquals(
-                "f info",
-                km.getSnippetBrackets(),
+        assertEquals("f info", km.getSnippetBrackets(),
                 "... [[{f/m:vier:{f/y:four:a}}{f/m:fuenf:{f/y:five:b}}{f/m:sechs:{f/y:six:c}}{f/m:sieben:{f/y:seven:a}}{f/m:acht:{f/y:eight:b}}{f/m:neun:{f/y:nine:a}}]] ...");
 
 
@@ -572,8 +553,8 @@
 
 
     @Test
-    public void indexExampleFailingFoundry () throws IOException,
-            QueryException {
+    public void indexExampleFailingFoundry ()
+            throws IOException, QueryException {
         KrillIndex ki = new KrillIndex();
         ki.addDoc(createSimpleFieldDoc4());
         ki.commit();
@@ -583,8 +564,8 @@
         JsonNode res = mapper.readTree(km.toJsonString());
         assertEquals("c1", res.at("/corpusID").asText());
         assertEquals("d4", res.at("/docID").asText());
-        assertEquals("Invalid foundry requested", res.at("/errors/0/1")
-                .asText());
+        assertEquals("Invalid foundry requested",
+                res.at("/errors/0/1").asText());
     };
 
 
@@ -633,18 +614,12 @@
         assertTrue(res.at("/endMore").asBoolean());
         assertEquals("ca1", res.at("/corpusID").asText());
         assertEquals("da1", res.at("/docID").asText());
-        assertEquals("<span class=\"context-left\">"
-                + "<span class=\"more\">"
-                + "</span>"
-                + "</span>"
-                + "<span class=\"match\"><mark>"
-                +
+        assertEquals("<span class=\"context-left\">" + "<span class=\"more\">"
+                + "</span>" + "</span>" + "<span class=\"match\"><mark>" +
                 //                     "<span title=\"@:x/s:key:value\">"+
-                "<span title=\"f/m:acht\">"
-                + "<span title=\"f/y:eight\">"
+                "<span title=\"f/m:acht\">" + "<span title=\"f/y:eight\">"
                 + "<span title=\"it/is:8\">"
-                + "<span title=\"x/o:achtens\">b</span>"
-                +
+                + "<span title=\"x/o:achtens\">b</span>" +
                 //                     "</span>"+
                 "</span>" + "</span>" + "</span>" + "<span title=\"f/m:neun\">"
                 + "<span title=\"f/y:nine\">" + "<span title=\"it/is:9\">"
@@ -662,9 +637,7 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("corpusID", "c1");
         fd.addString("ID", "d1");
-        fd.addTV(
-                "tokens",
-                "abcabcabac",
+        fd.addTV("tokens", "abcabcabac",
                 "[(0-1)s:a|i:a|f/m:eins|f/y:one|x/o:erstens|it/is:1|>:x/rel:a$<b>32<i>4<s>0<s>0<s>0|_0$<i>0<i>1|-:t$<i>10]"
                         + "[(1-2)s:b|i:b|f/m:zwei|f/y:two|x/o:zweitens|it/is:2|_1$<i>1<i>2]"
                         + "[(2-3)s:c|i:c|f/m:drei|f/y:three|x/o:drittens|it/is:3|_2$<i>2<i>3|<>:base/s:s$<b>64<i>2<i>5<i>5]"
@@ -683,9 +656,7 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("corpusID", "c1");
         fd.addString("ID", "d1");
-        fd.addTV(
-                "tokens",
-                "abcabcabac",
+        fd.addTV("tokens", "abcabcabac",
                 "[(0-1)s:a|i:a|f/m:eins|f/y:one|x/o:erstens|it/is:1|>:x/rel:a$<b>32<i>4<s>0<s>0<s>0|_0$<i>0<i>1|-:t$<i>10]"
                         + "[(1-2)s:b|i:b|f/m:zwei|f/y:two|x/o:zweitens|it/is:2|>:x/rel:b$<b>32<i>4<s>0<s>0<s>0|_1$<i>1<i>2]"
                         + "[(2-3)s:c|i:c|f/m:drei|f/y:three|x/o:drittens|it/is:3|_2$<i>2<i>3|<>:base/s:s$<b>64<i>2<i>5<i>5]"
@@ -704,9 +675,7 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("corpusID", "c1");
         fd.addString("ID", "d3");
-        fd.addTV(
-                "tokens",
-                "aa bb cc aa bb cc aa bb aa cc ",
+        fd.addTV("tokens", "aa bb cc aa bb cc aa bb aa cc ",
                 "[(0-2)s:aa|i:a|f/m:eins|f/y:one|x/o:erstens|it/is:1|>:x/rel:a$<b>32<i>4<s>0<s>0<s>0|_0$<i>0<i>2|-:t$<i>10]"
                         + "[(3-5)s:bb|i:b|f/m:zwei|f/y:two|x/o:zweitens|it/is:2|_1$<i>3<i>5]"
                         + "[(6-8)s:cc|i:c|f/m:drei|f/y:three|x/o:drittens|it/is:3|_2$<i>6<i>8|<>:base/s:s$<b>64<i>6<i>14<i>5]"
@@ -725,9 +694,7 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("corpusID", "c1");
         fd.addString("ID", "d4");
-        fd.addTV(
-                "tokens",
-                "abcabcabac",
+        fd.addTV("tokens", "abcabcabac",
                 "[(0-1)s:a|i:a|f/m:eins|f/y:one|x/o:erstens|it/is:1|>:x/rel:a$<b>32<i>4<s>0<s>0<s>0|_0$<i>0<i>1|-:t$<i>10]"
                         + "[(1-2)s:b|i:b|f/m:zwei|f/y:two|x/o:zweitens|it/is:2|_1$<i>1<i>2]"
                         + "[(2-3)s:c|i:c|f/m:drei|f/y:three|x/o:drittens|it/is:3|_2$<i>2<i>3|<>:base/s:s$<b>64<i>2<i>5<i>5]"
@@ -749,9 +716,7 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("corpusID", "ca1");
         fd.addString("ID", "da1");
-        fd.addTV(
-                "tokens",
-                "abcabcabac",
+        fd.addTV("tokens", "abcabcabac",
                 "[(0-1)s:a|i:a|f/m:eins|f/y:one|x/o:erstens|it/is:1|_0$<i>0<i>1|-:t$<i>10]"
                         + "[(1-2)s:b|i:b|f/m:zwei|f/y:two|x/o:zweitens|it/is:2|_1$<i>1<i>2]"
                         + "[(2-3)s:c|i:c|f/m:drei|f/y:three|x/o:drittens|it/is:3|_2$<i>2<i>3|<>:base/s:s$<b>64<i>2<i>5<i>5]"
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestMatchIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestMatchIndex.java
index fe3212d..932d448 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMatchIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMatchIndex.java
@@ -52,10 +52,18 @@
         SpanQuery sq;
         Result kr;
 
-        sq = new SpanFocusQuery(new SpanClassQuery(new SpanNextQuery(
-                new SpanClassQuery(new SpanTermQuery(new Term("base", "s:b")),
-                        (byte) 1), new SpanClassQuery(new SpanTermQuery(
-                        new Term("base", "s:c")), (byte) 2)), (byte) 3),
+        sq = new SpanFocusQuery(
+                new SpanClassQuery(
+                        new SpanNextQuery(
+                                new SpanClassQuery(
+                                        new SpanTermQuery(
+                                                new Term("base", "s:b")),
+                                        (byte) 1),
+                                new SpanClassQuery(
+                                        new SpanTermQuery(
+                                                new Term("base", "s:c")),
+                                        (byte) 2)),
+                        (byte) 3),
                 (byte) 3);
 
         kr = ki.search(sq, (short) 10);
@@ -63,12 +71,12 @@
         assertEquals("totalResults", kr.getTotalResults(), 2);
         assertEquals("StartPos (0)", 1, kr.getMatch(0).startPos);
         assertEquals("EndPos (0)", 3, kr.getMatch(0).endPos);
-        assertEquals("SnippetBrackets (0)", "a[[{3:{1:b}{2:c}}]]abcaba ...", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("SnippetBrackets (0)", "a[[{3:{1:b}{2:c}}]]abcaba ...",
+                kr.getMatch(0).getSnippetBrackets());
         assertEquals("StartPos (1)", 4, kr.getMatch(1).startPos);
         assertEquals("EndPos (1)", 6, kr.getMatch(1).endPos);
-        assertEquals("SnippetBrackets (1)", "abca[[{3:{1:b}{2:c}}]]abac", kr
-                .getMatch(1).getSnippetBrackets());
+        assertEquals("SnippetBrackets (1)", "abca[[{3:{1:b}{2:c}}]]abac",
+                kr.getMatch(1).getSnippetBrackets());
 
         assertEquals("Document count", 1, ki.numberOf("base", "documents"));
         assertEquals("Token count", 10, ki.numberOf("base", "t"));
@@ -103,37 +111,38 @@
         assertEquals("StartPos (0)", 7, kr.getMatch(0).startPos);
         assertEquals("EndPos (0)", 9, kr.getMatch(0).endPos);
 
-        assertEquals("SnippetBrackets (0)", "... bcabca[[b{1:a}]]c", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("SnippetBrackets (0)", "... bcabca[[b{1:a}]]c",
+                kr.getMatch(0).getSnippetBrackets());
 
-        assertEquals(
-                "Test no 'more' context",
+        assertEquals("Test no 'more' context",
                 "<span class=\"context-left\"><span class=\"more\"></span>bcabca</span><span class=\"match\"><mark>b<mark class=\"class-1 level-0\">a</mark></mark></span><span class=\"context-right\">c</span>",
                 kr.getMatch(0).getSnippetHTML());
 
 
-        sq = new SpanFocusQuery(new SpanNextQuery(new SpanTermQuery(new Term(
-                "base", "s:b")), new SpanClassQuery(new SpanTermQuery(new Term(
-                "base", "s:a")))));
+        sq = new SpanFocusQuery(new SpanNextQuery(
+                new SpanTermQuery(new Term("base", "s:b")), new SpanClassQuery(
+                        new SpanTermQuery(new Term("base", "s:a")))));
         kr = ki.search(sq, (short) 10);
 
         assertEquals("totalResults", kr.getTotalResults(), 1);
         assertEquals("StartPos (0)", 8, kr.getMatch(0).startPos);
         assertEquals("EndPos (0)", 9, kr.getMatch(0).endPos);
-        assertEquals("SnippetBrackets (0)", "... cabcab[[{1:a}]]c", kr
-                .getMatch(0).getSnippetBrackets());
-        sq = new SpanFocusQuery(new SpanNextQuery(new SpanClassQuery(
-                new SpanTermQuery(new Term("base", "s:a")), (byte) 2),
+        assertEquals("SnippetBrackets (0)", "... cabcab[[{1:a}]]c",
+                kr.getMatch(0).getSnippetBrackets());
+        sq = new SpanFocusQuery(new SpanNextQuery(
+                new SpanClassQuery(new SpanTermQuery(new Term("base", "s:a")),
+                        (byte) 2),
                 new SpanClassQuery(new SpanTermQuery(new Term("base", "s:b")),
-                        (byte) 3)), (byte) 3);
+                        (byte) 3)),
+                (byte) 3);
 
         kr = ki.search(sq, (short) 10);
 
         assertEquals("totalResults", kr.getTotalResults(), 3);
         assertEquals("StartPos (0)", 1, kr.getMatch(0).startPos);
         assertEquals("EndPos (0)", 2, kr.getMatch(0).endPos);
-        assertEquals("SnippetBrackets (0)", "a[[{3:b}]]cabcab ...", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("SnippetBrackets (0)", "a[[{3:b}]]cabcab ...",
+                kr.getMatch(0).getSnippetBrackets());
 
 
         assertEquals(
@@ -142,8 +151,8 @@
 
         assertEquals("StartPos (1)", 4, kr.getMatch(1).startPos);
         assertEquals("EndPos (1)", 5, kr.getMatch(1).endPos);
-        assertEquals("SnippetBrackets (1)", "abca[[{3:b}]]cabac", kr
-                .getMatch(1).getSnippetBrackets());
+        assertEquals("SnippetBrackets (1)", "abca[[{3:b}]]cabac",
+                kr.getMatch(1).getSnippetBrackets());
 
         assertEquals(
                 "<span class=\"context-left\">abca</span><span class=\"match\"><mark><mark class=\"class-3 level-0\">b</mark></mark></span><span class=\"context-right\">cabac</span>",
@@ -151,77 +160,82 @@
 
         assertEquals("StartPos (2)", 7, kr.getMatch(2).startPos);
         assertEquals("EndPos (2)", 8, kr.getMatch(2).endPos);
-        assertEquals("SnippetBrackets (2)", "... bcabca[[{3:b}]]ac", kr
-                .getMatch(2).getSnippetBrackets());
+        assertEquals("SnippetBrackets (2)", "... bcabca[[{3:b}]]ac",
+                kr.getMatch(2).getSnippetBrackets());
 
 
 
         // abcabcabac
-        sq = new SpanFocusQuery(
-                new SpanNextQuery(new SpanTermQuery(new Term("base", "s:a")),
-                        new SpanClassQuery(new SpanNextQuery(new SpanTermQuery(
-                                new Term("base", "s:b")), new SpanClassQuery(
-                                new SpanTermQuery(new Term("base", "s:a")))),
-                                (byte) 2)), (byte) 2);
+        sq = new SpanFocusQuery(new SpanNextQuery(
+                new SpanTermQuery(new Term("base", "s:a")),
+                new SpanClassQuery(
+                        new SpanNextQuery(new SpanTermQuery(
+                                new Term("base", "s:b")),
+                                new SpanClassQuery(new SpanTermQuery(
+                                        new Term("base", "s:a")))),
+                        (byte) 2)),
+                (byte) 2);
 
         kr = ki.search(sq, (short) 10);
 
         assertEquals("totalResults", kr.getTotalResults(), 1);
-        assertEquals("SnippetBrackets (0)", "... bcabca[[{2:b{1:a}}]]c", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("SnippetBrackets (0)", "... bcabca[[{2:b{1:a}}]]c",
+                kr.getMatch(0).getSnippetBrackets());
 
-        assertEquals(
-                "SnippetHTML (0) 1",
+        assertEquals("SnippetHTML (0) 1",
                 "<span class=\"context-left\"><span class=\"more\"></span>bcabca</span><span class=\"match\"><mark><mark class=\"class-2 level-0\">b<mark class=\"class-1 level-1\">a</mark></mark></mark></span><span class=\"context-right\">c</span>",
                 kr.getMatch(0).getSnippetHTML());
 
         // Offset tokens
         kr = ki.search(sq, 0, (short) 10, true, (short) 2, true, (short) 2);
         assertEquals("totalResults", kr.getTotalResults(), 1);
-        assertEquals("SnippetBrackets (0)", "... ca[[{2:b{1:a}}]]c", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("SnippetBrackets (0)", "... ca[[{2:b{1:a}}]]c",
+                kr.getMatch(0).getSnippetBrackets());
 
 
 
         // Offset Characters
         kr = ki.search(sq, 0, (short) 10, false, (short) 1, false, (short) 0);
         assertEquals("totalResults", kr.getTotalResults(), 1);
-        assertEquals("SnippetBrackets (0)", "... a[[{2:b{1:a}}]] ...", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("SnippetBrackets (0)", "... a[[{2:b{1:a}}]] ...",
+                kr.getMatch(0).getSnippetBrackets());
 
-        assertEquals(
-                "SnippetHTML (0) 2",
+        assertEquals("SnippetHTML (0) 2",
                 "<span class=\"context-left\"><span class=\"more\"></span>a</span><span class=\"match\"><mark><mark class=\"class-2 level-0\">b<mark class=\"class-1 level-1\">a</mark></mark></mark></span><span class=\"context-right\"><span class=\"more\"></span></span>",
                 kr.getMatch(0).getSnippetHTML());
 
 
 
         // Don't match the expected class!
-        sq = new SpanFocusQuery(new SpanNextQuery(new SpanClassQuery(
-                new SpanTermQuery(new Term("base", "s:b")), (byte) 1),
+        sq = new SpanFocusQuery(new SpanNextQuery(
+                new SpanClassQuery(new SpanTermQuery(new Term("base", "s:b")),
+                        (byte) 1),
                 new SpanClassQuery(new SpanTermQuery(new Term("base", "s:c")),
-                        (byte) 2)), (byte) 3);
+                        (byte) 2)),
+                (byte) 3);
 
         kr = ki.search(sq, (short) 10);
 
         assertEquals("totalResults", kr.getTotalResults(), 0);
 
-        sq = new SpanFocusQuery(new SpanNextQuery(new SpanTermQuery(new Term(
-                "base", "s:a")), new SpanClassQuery(new SpanNextQuery(
-                new SpanTermQuery(new Term("base", "s:b")), new SpanTermQuery(
-                        new Term("base", "s:c"))))));
+        sq = new SpanFocusQuery(
+                new SpanNextQuery(new SpanTermQuery(new Term("base", "s:a")),
+                        new SpanClassQuery(new SpanNextQuery(
+                                new SpanTermQuery(new Term("base",
+                                        "s:b")),
+                                new SpanTermQuery(new Term("base", "s:c"))))));
 
         kr = ki.search(sq, (short) 2);
 
         assertEquals("totalResults", kr.getTotalResults(), 2);
         assertEquals("StartPos (0)", 1, kr.getMatch(0).startPos);
         assertEquals("EndPos (0)", 3, kr.getMatch(0).endPos);
-        assertEquals("SnippetBrackets (0)", "a[[{1:bc}]]abcaba ...", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("SnippetBrackets (0)", "a[[{1:bc}]]abcaba ...",
+                kr.getMatch(0).getSnippetBrackets());
         assertEquals("StartPos (1)", 4, kr.getMatch(1).startPos);
         assertEquals("EndPos (1)", 6, kr.getMatch(1).endPos);
-        assertEquals("SnippetBrackets (1)", "abca[[{1:bc}]]abac", kr
-                .getMatch(1).getSnippetBrackets());
+        assertEquals("SnippetBrackets (1)", "abca[[{1:bc}]]abac",
+                kr.getMatch(1).getSnippetBrackets());
 
         assertEquals(1, ki.numberOf("base", "documents"));
         assertEquals(10, ki.numberOf("base", "t"));
@@ -252,48 +266,42 @@
         kr = ki.search(sq, (short) 20);
 
         assertEquals("totalResults", kr.getTotalResults(), 7);
-        assertEquals(
-                "SnippetBrackets (0)",
+        assertEquals("SnippetBrackets (0)",
                 "<span class=\"context-left\"></span><span class=\"match\"><mark>a</mark></span><span class=\"context-right\">bcabca<span class=\"more\"></span></span>",
                 kr.getMatch(0).getSnippetHTML());
-        assertEquals("SnippetBrackets (0)", "[[a]]bcabca ...", kr.getMatch(0)
-                .getSnippetBrackets());
+        assertEquals("SnippetBrackets (0)", "[[a]]bcabca ...",
+                kr.getMatch(0).getSnippetBrackets());
 
-        assertEquals("SnippetBrackets (1)", "ab[[c]]abcaba ...", kr.getMatch(1)
-                .getSnippetBrackets());
-        assertEquals(
-                "SnippetBrackets (1)",
+        assertEquals("SnippetBrackets (1)", "ab[[c]]abcaba ...",
+                kr.getMatch(1).getSnippetBrackets());
+        assertEquals("SnippetBrackets (1)",
                 "<span class=\"context-left\">ab</span><span class=\"match\"><mark>c</mark></span><span class=\"context-right\">abcaba<span class=\"more\"></span></span>",
                 kr.getMatch(1).getSnippetHTML());
 
-        assertEquals("SnippetBrackets (6)", "... abcaba[[c]]", kr.getMatch(6)
-                .getSnippetBrackets());
-        assertEquals(
-                "SnippetBrackets (6)",
+        assertEquals("SnippetBrackets (6)", "... abcaba[[c]]",
+                kr.getMatch(6).getSnippetBrackets());
+        assertEquals("SnippetBrackets (6)",
                 "<span class=\"context-left\"><span class=\"more\"></span>abcaba</span><span class=\"match\"><mark>c</mark></span><span class=\"context-right\"></span>",
                 kr.getMatch(6).getSnippetHTML());
 
         kr = ki.search(sq, 0, (short) 20, true, (short) 0, true, (short) 0);
 
         assertEquals("totalResults", kr.getTotalResults(), 7);
-        assertEquals("SnippetBrackets (0)", "[[a]] ...", kr.getMatch(0)
-                .getSnippetBrackets());
-        assertEquals(
-                "SnippetHTML (0)",
+        assertEquals("SnippetBrackets (0)", "[[a]] ...",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("SnippetHTML (0)",
                 "<span class=\"context-left\"></span><span class=\"match\"><mark>a</mark></span><span class=\"context-right\"><span class=\"more\"></span></span>",
                 kr.getMatch(0).getSnippetHTML());
 
-        assertEquals("SnippetBrackets (1)", "... [[c]] ...", kr.getMatch(1)
-                .getSnippetBrackets());
-        assertEquals(
-                "SnippetHTML (1)",
+        assertEquals("SnippetBrackets (1)", "... [[c]] ...",
+                kr.getMatch(1).getSnippetBrackets());
+        assertEquals("SnippetHTML (1)",
                 "<span class=\"context-left\"><span class=\"more\"></span></span><span class=\"match\"><mark>c</mark></span><span class=\"context-right\"><span class=\"more\"></span></span>",
                 kr.getMatch(1).getSnippetHTML());
 
-        assertEquals("SnippetBrackets (6)", "... [[c]]", kr.getMatch(6)
-                .getSnippetBrackets());
-        assertEquals(
-                "SnippetBrackets (6)",
+        assertEquals("SnippetBrackets (6)", "... [[c]]",
+                kr.getMatch(6).getSnippetBrackets());
+        assertEquals("SnippetBrackets (6)",
                 "<span class=\"context-left\"><span class=\"more\"></span></span><span class=\"match\"><mark>c</mark></span><span class=\"context-right\"></span>",
                 kr.getMatch(6).getSnippetHTML());
     };
@@ -318,16 +326,14 @@
 
         QueryBuilder kq = new QueryBuilder("base");
 
-        SpanQuery sq = kq._(
-                1,
-                kq.seq(kq.seg("s:b")).append(kq.seg("s:a"))
-                        .append(kq._(2, kq.seg("s:c")))).toQuery();
+        SpanQuery sq = kq._(1, kq.seq(kq.seg("s:b")).append(kq.seg("s:a"))
+                .append(kq._(2, kq.seg("s:c")))).toQuery();
 
         kr = ki.search(sq, 0, (short) 20, true, (short) 2, true, (short) 5);
 
         assertEquals("totalResults", kr.getTotalResults(), 1);
-        assertEquals("SnippetBrackets (0)", "... ca[[{1:ba{2:c}}]]", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("SnippetBrackets (0)", "... ca[[{1:ba{2:c}}]]",
+                kr.getMatch(0).getSnippetBrackets());
     };
 
 
@@ -349,10 +355,12 @@
         SpanQuery sq;
         Result kr;
 
-        sq = new SpanFocusQuery(new SpanNextQuery(new SpanClassQuery(
-                new SpanTermQuery(new Term("base", "s:a")), (byte) 2),
+        sq = new SpanFocusQuery(new SpanNextQuery(
+                new SpanClassQuery(new SpanTermQuery(new Term("base", "s:a")),
+                        (byte) 2),
                 new SpanClassQuery(new SpanTermQuery(new Term("base", "s:b")),
-                        (byte) 3)), (byte) 3);
+                        (byte) 3)),
+                (byte) 3);
 
         kr = ki.search(sq, (short) 10);
 
@@ -364,10 +372,18 @@
         assertEquals("SnippetBrackets (0)", "a[[{3:b}]]cabcab ...",
                 km.getSnippetBrackets());
 
-        sq = new SpanFocusQuery(new SpanFocusQuery(new SpanNextQuery(
-                new SpanClassQuery(new SpanTermQuery(new Term("base", "s:a")),
-                        (byte) 2), new SpanClassQuery(new SpanTermQuery(
-                        new Term("base", "s:b")), (byte) 3)), (byte) 3),
+        sq = new SpanFocusQuery(
+                new SpanFocusQuery(
+                        new SpanNextQuery(
+                                new SpanClassQuery(
+                                        new SpanTermQuery(
+                                                new Term("base", "s:a")),
+                                        (byte) 2),
+                                new SpanClassQuery(
+                                        new SpanTermQuery(
+                                                new Term("base", "s:b")),
+                                        (byte) 3)),
+                        (byte) 3),
                 (byte) 2);
 
         kr = ki.search(sq, (short) 10);
@@ -411,10 +427,11 @@
         //        assertEquals(kr.getMatch(0).getSnippetBrackets(),
         //                "a[{2:{3:b}cab}]cabac");
 
-        sq = new SpanFocusQuery(new SpanWithinQuery(new SpanClassQuery(
-                new SpanElementQuery("base", "s"), (byte) 2),
+        sq = new SpanFocusQuery(new SpanWithinQuery(
+                new SpanClassQuery(new SpanElementQuery("base", "s"), (byte) 2),
                 new SpanClassQuery(new SpanTermQuery(new Term("base", "s:b")),
-                        (byte) 3)), (byte) 3);
+                        (byte) 3)),
+                (byte) 3);
 
         kr = ki.search(sq, (short) 10);
         assertEquals(kr.getSerialQuery(),
@@ -432,9 +449,8 @@
         // abcabcabac
         FieldDocument fd = new FieldDocument();
         fd.addTV("base", "abcabcabac",
-        // The payload should be ignored
-                "[(0-1)s:a|i:a|_0$<i>0<i>1|-:t$<i>10]"
-                        + // |<>:p#0-10<i>9]" +
+                // The payload should be ignored
+                "[(0-1)s:a|i:a|_0$<i>0<i>1|-:t$<i>10]" + // |<>:p#0-10<i>9]" +
                         "[(1-2)s:b|i:b|_1$<i>1<i>2|<>:s$<b>64<i>1<i>5<i>5]"
                         + "[(2-3)s:c|i:c|_2$<i>2<i>3|<>:s$<b>64<i>2<i>7<i>7]"
                         + "[(3-4)s:a|i:a|_3$<i>3<i>4]"
@@ -489,17 +505,18 @@
 
         // within(<p>, focus(3:within({2:<s>}, {3:a})))
         sq = new SpanWithinQuery(new SpanElementQuery("base", "p"),
-                new SpanFocusQuery(new SpanWithinQuery(new SpanClassQuery(
-                        new SpanElementQuery("base", "s"), (byte) 2),
-                        new SpanClassQuery(new SpanTermQuery(new Term("base",
-                                "s:a")), (byte) 3)), (byte) 3));
+                new SpanFocusQuery(new SpanWithinQuery(
+                        new SpanClassQuery(new SpanElementQuery("base", "s"),
+                                (byte) 2),
+                        new SpanClassQuery(
+                                new SpanTermQuery(new Term("base", "s:a")),
+                                (byte) 3)),
+                        (byte) 3));
 
         // fail("Skipping may go horribly wrong! (Known issue)");
 
         Krill ks = new Krill(sq);
-        ks.getMeta()
-                .setStartIndex(0)
-                .setCount((short) 20)
+        ks.getMeta().setStartIndex(0).setCount((short) 20)
                 .setContext(new SearchContext(true, (short) 5, true, (short) 5))
         // .setCollection(kc)
         ;
@@ -507,16 +524,15 @@
         kr = ks.apply(ki);
         // kr = ki.search(kc, sq, 0, (short) 20, true, (short) 5, true, (short) 5);
 
-        assertEquals(
-                kr.getSerialQuery(),
+        assertEquals(kr.getSerialQuery(),
                 "spanContain(<base:p />, focus(3: spanContain({2: <base:s />}, {3: base:s:a})))");
         assertEquals(12, kr.getTotalResults());
-        assertEquals("[a{2:bc{3:a}b}cabac]", kr.getMatch(0)
-                .getSnippetBrackets());
-        assertEquals("[ab{2:c{3:a}bcab}ac]", kr.getMatch(1)
-                .getSnippetBrackets());
-        assertEquals("[ab{2:cabc{3:a}}bac]", kr.getMatch(2)
-                .getSnippetBrackets());
+        assertEquals("[a{2:bc{3:a}b}cabac]",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("[ab{2:c{3:a}bcab}ac]",
+                kr.getMatch(1).getSnippetBrackets());
+        assertEquals("[ab{2:cabc{3:a}}bac]",
+                kr.getMatch(2).getSnippetBrackets());
     };
 
 };
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestMultipleDistanceIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestMultipleDistanceIndex.java
index 7054aa4..c6363e5 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestMultipleDistanceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestMultipleDistanceIndex.java
@@ -53,9 +53,7 @@
     private FieldDocument createFieldDoc0 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
-        fd.addTV(
-                "base",
-                "text",
+        fd.addTV("base", "text",
                 "[(0-1)s:b|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>2<b>0|<>:p$<b>64<i>0<i>4<i>4<b>0]"
                         + "[(1-2)s:b|s:c|_2$<i>1<i>2]"
                         + "[(2-3)s:c|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>4<b>0]"
@@ -69,9 +67,7 @@
     private FieldDocument createFieldDoc1 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
-        fd.addTV(
-                "base",
-                "text",
+        fd.addTV("base", "text",
                 "[(0-1)s:c|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>2<b>0|<>:p$<b>64<i>0<i>4<i>4<b>0]"
                         + "[(1-2)s:c|s:e|_2$<i>1<i>2]"
                         + "[(2-3)s:e|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>4<b>0]"
@@ -85,9 +81,7 @@
     private FieldDocument createFieldDoc2 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
-        fd.addTV(
-                "base",
-                "text",
+        fd.addTV("base", "text",
                 "[(0-1)s:b|_1$<i>0<i>1|<>:s$<b>64<i>0<i>2<i>2<b>0|<>:p$<b>64<i>0<i>4<i>4<b>0]"
                         + "[(1-2)s:b|s:e|_2$<i>1<i>2]"
                         + "[(2-3)s:e|_3$<i>2<i>3|<>:s$<b>64<i>2<i>3<i>4<b>0]"
@@ -115,7 +109,7 @@
 
     /**
      * Unordered, same sentence
-     * */
+     */
     @Test
     public void testCase1 () throws IOException {
         ki = new KrillIndex();
@@ -146,7 +140,7 @@
      * Unordered
      * Two constraints
      * Three constraints
-     * */
+     */
     @Test
     public void testCase2 () throws IOException {
         ki = new KrillIndex();
@@ -199,7 +193,7 @@
     /**
      * Multiple documents
      * Ensure same doc (inner term span)
-     * */
+     */
     @Test
     public void testCase3 () throws IOException {
         ki = new KrillIndex();
@@ -241,7 +235,7 @@
 
     /**
      * Skip to
-     * */
+     */
     @Test
     public void testCase4 () throws IOException {
         ki = new KrillIndex();
@@ -258,8 +252,8 @@
         SpanQuery mdq;
         mdq = createQuery("s:b", "s:c", constraints, false);
 
-        SpanQuery sq = new SpanNextQuery(mdq, new SpanTermQuery(new Term(
-                "base", "s:e")));
+        SpanQuery sq = new SpanNextQuery(mdq,
+                new SpanTermQuery(new Term("base", "s:e")));
         kr = ki.search(sq, (short) 10);
 
         assertEquals((long) 2, kr.getTotalResults());
@@ -274,7 +268,7 @@
 
     /**
      * Same tokens: ordered and unordered yield the same results
-     * */
+     */
     @Test
     public void testCase5 () throws IOException {
         ki = new KrillIndex();
@@ -307,7 +301,7 @@
     /**
      * Exclusion
      * Gaps
-     * */
+     */
     @Test
     public void testCase6 () throws IOException {
         ki = new KrillIndex();
@@ -351,7 +345,7 @@
 
     /**
      * Exclusion, multiple documents
-     * */
+     */
     @Test
     public void testCase7 () throws IOException {
         ki = new KrillIndex();
@@ -361,8 +355,8 @@
         SpanQuery sx = new SpanTermQuery(new Term("base", "s:b"));
         SpanQuery sy = new SpanTermQuery(new Term("base", "s:c"));
         // Second constraint
-        SpanDistanceQuery sq = new SpanDistanceQuery(sx, sy, createConstraint(
-                "s", 0, 0, false, true), true);
+        SpanDistanceQuery sq = new SpanDistanceQuery(sx, sy,
+                createConstraint("s", 0, 0, false, true), true);
         kr = ki.search(sq, (short) 10);
         assertEquals((long) 3, kr.getTotalResults());
         // 0-1, 1-2, 6-7
@@ -383,8 +377,8 @@
 
 
         // Third constraint
-        sq = new SpanDistanceQuery(sx, sy, createConstraint("p", 0, 0, false,
-                true), true);
+        sq = new SpanDistanceQuery(sx, sy,
+                createConstraint("p", 0, 0, false, true), true);
         kr = ki.search(sq, (short) 10);
         assertEquals((long) 1, kr.getTotalResults());
         // 6-7
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java
index 561d6bb..16ced0a 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java
@@ -96,19 +96,13 @@
 
         // abcabcabac
         FieldDocument fd = new FieldDocument();
-        fd.addTV(
-                "base",
-                "abcabcabac",
-                "[(0-1)s:a|i:a|_0$<i>0<i>1|-:t$<i>10]"
-                        + "[(1-2)s:b|i:b|_1$<i>1<i>2]"
-                        + "[(2-3)s:c|i:c|_2$<i>2<i>3]"
-                        + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:x$<b>64<i>3<i>4<i>4<b>0|<>:x$<b>64<i>3<i>7<i>7<b>0]"
-                        + "[(4-5)s:b|i:b|_4$<i>4<i>5]"
-                        + "[(5-6)s:c|i:c|_5$<i>5<i>6]"
-                        + "[(6-7)s:a|i:a|_6$<i>6<i>7]"
-                        + "[(7-8)s:b|i:b|_7$<i>7<i>8]"
-                        + "[(8-9)s:a|i:a|_8$<i>8<i>9]"
-                        + "[(9-10)s:c|i:c|_9$<i>9<i>10]");
+        fd.addTV("base", "abcabcabac", "[(0-1)s:a|i:a|_0$<i>0<i>1|-:t$<i>10]"
+                + "[(1-2)s:b|i:b|_1$<i>1<i>2]" + "[(2-3)s:c|i:c|_2$<i>2<i>3]"
+                + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:x$<b>64<i>3<i>4<i>4<b>0|<>:x$<b>64<i>3<i>7<i>7<b>0]"
+                + "[(4-5)s:b|i:b|_4$<i>4<i>5]" + "[(5-6)s:c|i:c|_5$<i>5<i>6]"
+                + "[(6-7)s:a|i:a|_6$<i>6<i>7]" + "[(7-8)s:b|i:b|_7$<i>7<i>8]"
+                + "[(8-9)s:a|i:a|_8$<i>8<i>9]"
+                + "[(9-10)s:c|i:c|_9$<i>9<i>10]");
         ki.addDoc(fd);
 
         ki.commit();
@@ -136,7 +130,8 @@
                 + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7<b>0]"
                 + "[(4-5)s:b|i:b|_4$<i>4<i>5]" + "[(5-6)s:c|i:c|_5$<i>5<i>6]"
                 + "[(6-7)s:a|i:a|_6$<i>6<i>7]" + "[(7-8)s:b|i:b|_7$<i>7<i>8]"
-                + "[(8-9)s:a|i:a|_8$<i>8<i>9]" + "[(9-10)s:c|i:c|_9$<i>9<i>10]");
+                + "[(8-9)s:a|i:a|_8$<i>8<i>9]"
+                + "[(9-10)s:c|i:c|_9$<i>9<i>10]");
         ki.addDoc(fd);
 
         ki.commit();
@@ -177,7 +172,8 @@
                 + "[(3-4)s:x|i:x|_3$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7<b>0]"
                 + "[(4-5)s:b|i:b|_4$<i>4<i>5]" + "[(5-6)s:z|i:z|_5$<i>5<i>6]"
                 + "[(6-7)s:x|i:x|_6$<i>6<i>7]" + "[(7-8)s:b|i:b|_7$<i>7<i>8]"
-                + "[(8-9)s:x|i:x|_8$<i>8<i>9]" + "[(9-10)s:z|i:z|_9$<i>9<i>10]");
+                + "[(8-9)s:x|i:x|_8$<i>8<i>9]"
+                + "[(9-10)s:z|i:z|_9$<i>9<i>10]");
         ki.addDoc(fd);
         ki.commit();
 
@@ -211,7 +207,7 @@
     /**
      * Multiple atomic indices
      * Skip to a greater doc#
-     * */
+     */
     @Test
     public void indexExample5 () throws IOException {
         KrillIndex ki = new KrillIndex();
@@ -221,8 +217,9 @@
         ki.addDoc(createFieldDoc3());
         ki.commit();
 
-        SpanQuery sq = new SpanNextQuery(new SpanTermQuery(new Term("base",
-                "s:d")), new SpanTermQuery(new Term("base", "s:b")));
+        SpanQuery sq = new SpanNextQuery(
+                new SpanTermQuery(new Term("base", "s:d")),
+                new SpanTermQuery(new Term("base", "s:b")));
         Result kr = ki.search(sq, (short) 10);
 
         assertEquals("totalResults", kr.getTotalResults(), 2);
@@ -255,9 +252,10 @@
         ki.addDoc(createFieldDoc3());
         ki.commit();
 
-        SpanQuery sq = new SpanNextQuery(new SpanTermQuery(new Term("base",
-                "s:c")), new SpanNextQuery(new SpanTermQuery(new Term("base",
-                "s:d")), new SpanTermQuery(new Term("base", "s:b"))));
+        SpanQuery sq = new SpanNextQuery(
+                new SpanTermQuery(new Term("base", "s:c")),
+                new SpanNextQuery(new SpanTermQuery(new Term("base", "s:d")),
+                        new SpanTermQuery(new Term("base", "s:b"))));
 
         Result kr = ki.search(sq, (short) 10);
         assertEquals("totalResults", kr.getTotalResults(), 1);
@@ -265,12 +263,16 @@
         assertEquals("StartPos", 0, kr.getMatch(0).startPos);
         assertEquals("EndPos", 3, kr.getMatch(0).endPos);
 
-        sq = new SpanNextQuery(new SpanTermQuery(new Term("base", "s:c")),
-                new SpanNextQuery(new SpanFocusQuery(new SpanClassQuery(
-                        new SpanTermQuery(new Term("base", "s:d")), (byte) 1),
-                        (byte) 1), new SpanFocusQuery(new SpanClassQuery(
-                        new SpanTermQuery(new Term("base", "s:b")), (byte) 2),
-                        (byte) 2)));
+        sq = new SpanNextQuery(
+                new SpanTermQuery(
+                        new Term("base", "s:c")),
+                new SpanNextQuery(
+                        new SpanFocusQuery(new SpanClassQuery(
+                                new SpanTermQuery(new Term("base", "s:d")),
+                                (byte) 1), (byte) 1),
+                        new SpanFocusQuery(new SpanClassQuery(
+                                new SpanTermQuery(new Term("base", "s:b")),
+                                (byte) 2), (byte) 2)));
 
         kr = ki.search(sq, (short) 10);
         assertEquals("doc-number", 2, kr.getMatch(0).getLocalDocID());
@@ -333,9 +335,10 @@
         ki.addDoc(createFieldDoc1());
         ki.commit();
 
-        SpanQuery sq = new SpanNextQuery(new SpanOrQuery(new SpanTermQuery(
-                new Term("base", "s:a")), new SpanTermQuery(new Term("base",
-                "s:b"))), new SpanTermQuery(new Term("base", "s:c")));
+        SpanQuery sq = new SpanNextQuery(
+                new SpanOrQuery(new SpanTermQuery(new Term("base", "s:a")),
+                        new SpanTermQuery(new Term("base", "s:b"))),
+                new SpanTermQuery(new Term("base", "s:c")));
 
         Result kr = ki.search(sq, (short) 10);
 
@@ -349,12 +352,12 @@
     private FieldDocument createFieldDoc1 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
-        fd.addTV("base", "bcbadb", "[(0-1)s:b|i:b|_0$<i>0<i>1]"
-                + "[(1-2)s:c|i:c|s:b|_1$<i>1<i>2]"
-                + "[(2-3)s:b|i:b|_2$<i>2<i>3]"
-                + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:e$<b>64<i>3<i>6<i>6<b>0]"
-                + "[(4-5)s:d|i:d|s:c|_4$<i>4<i>5]"
-                + "[(5-6)s:b|i:b|_5$<i>5<i>6]");
+        fd.addTV("base", "bcbadb",
+                "[(0-1)s:b|i:b|_0$<i>0<i>1]" + "[(1-2)s:c|i:c|s:b|_1$<i>1<i>2]"
+                        + "[(2-3)s:b|i:b|_2$<i>2<i>3]"
+                        + "[(3-4)s:a|i:a|_3$<i>3<i>4|<>:e$<b>64<i>3<i>6<i>6<b>0]"
+                        + "[(4-5)s:d|i:d|s:c|_4$<i>4<i>5]"
+                        + "[(5-6)s:b|i:b|_5$<i>5<i>6]");
         return fd;
     }
 
@@ -362,10 +365,11 @@
     private FieldDocument createFieldDoc2 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
-        fd.addTV("base", "caba", "[(0-1)s:c|i:c|_0$<i>0<i>1]"
-                + "[(1-2)s:a|i:a|s:c|_1$<i>1<i>2|<>:e$<b>64<i>1<i>3<i>3<b>0]"
-                + "[(2-3)s:b|i:b|s:a|_2$<i>2<i>3]"
-                + "[(3-4)s:a|i:a|_3$<i>3<i>4]");
+        fd.addTV("base", "caba",
+                "[(0-1)s:c|i:c|_0$<i>0<i>1]"
+                        + "[(1-2)s:a|i:a|s:c|_1$<i>1<i>2|<>:e$<b>64<i>1<i>3<i>3<b>0]"
+                        + "[(2-3)s:b|i:b|s:a|_2$<i>2<i>3]"
+                        + "[(3-4)s:a|i:a|_3$<i>3<i>4]");
         return fd;
     }
 
@@ -373,10 +377,10 @@
     private FieldDocument createFieldDoc3 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
-        fd.addTV("base", "cdbd", "[(0-1)s:c|i:c|_0$<i>0<i>1]"
-                + "[(1-2)s:d|i:d|_1$<i>1<i>2]"
-                + "[(2-3)s:b|i:b|s:a|_2$<i>2<i>3]"
-                + "[(3-4)s:d|i:d|_3$<i>3<i>4]");
+        fd.addTV("base", "cdbd",
+                "[(0-1)s:c|i:c|_0$<i>0<i>1]" + "[(1-2)s:d|i:d|_1$<i>1<i>2]"
+                        + "[(2-3)s:b|i:b|s:a|_2$<i>2<i>3]"
+                        + "[(3-4)s:d|i:d|_3$<i>3<i>4]");
 
         return fd;
     }
@@ -385,9 +389,7 @@
     private FieldDocument createFieldDoc4 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-3");
-        fd.addTV(
-                "base",
-                "bcbadb",
+        fd.addTV("base", "bcbadb",
                 "[(0-1)s:b|i:b|_0$<i>0<i>1]"
                         + "[(1-2)s:c|i:c|s:b|<>:s$<b>64<i>1<i>3<i>3<b>0|_1$<i>1<i>2<b>0]"
                         + "[(2-3)s:b|i:b|_2$<i>2<i>3]"
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestRealIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestRealIndex.java
index 09fd4a5..47a6117 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRealIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRealIndex.java
@@ -40,8 +40,10 @@
     @Test
     public void testCase1 () throws IOException, QueryException {
         QueryBuilder kq = new QueryBuilder("tokens");
-        ks = new Krill(kq.within(kq.tag("base/s:s"),
-                kq.seq(kq.re("s:.*")).append(kq._(kq.re("s:.*")))).toQuery());
+        ks = new Krill(kq
+                .within(kq.tag("base/s:s"),
+                        kq.seq(kq.re("s:.*")).append(kq._(kq.re("s:.*"))))
+                .toQuery());
         ks.getMeta().setTimeOut(10000);
         kr = ks.apply(ki);
         System.err.println(kr.toJsonString());
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestReferenceIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestReferenceIndex.java
index f1aeb02..fc4d57c 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestReferenceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestReferenceIndex.java
@@ -43,8 +43,8 @@
 
         SpanFocusQuery sfq1 = new SpanFocusQuery(snq1, (byte) 2);
 
-        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", "<:child-of")), true);
+        SpanRelationQuery srq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", "<:child-of")), true);
         // SpanSegmentQuery ssq = new SpanSegmentQuery(srq, sfq1,
         // true);
         // SpanFocusQuery sfq2 = new SpanFocusQuery(ssq, (byte) 1);
@@ -94,8 +94,9 @@
     @Test
     public void testCase2 () throws IOException, QueryException {
 
-        String filepath = getClass().getResource(
-                "/queries/reference/distance-reference.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/reference/distance-reference.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
 
@@ -108,7 +109,8 @@
                         + "focus(3: spanDistance(focus(1: spanDistance({1: <tokens:vb />}, "
                         + "{2: <tokens:prp />}, [(w[1:2], notOrdered, notExcluded)])), "
                         + "{3: <tokens:nn />}, [(w[1:3], notOrdered, notExcluded)]))))"
-                        + ")), 2)", sq.toString());
+                        + ")), 2)",
+                sq.toString());
 
         SpanElementQuery seq1 = new SpanElementQuery("tokens", "vb");
         // new SpanTermQuery(new Term("tokens", "c:vb"));
@@ -129,8 +131,9 @@
         SpanFocusQuery sfq2 = new SpanFocusQuery(sdq2, (byte) 3);
 
         // nn -> prp
-        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("tokens", ">:stanford/d:tag")), true);
+        SpanRelationQuery srq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("tokens", ">:stanford/d:tag")),
+                true);
         SpanRelationMatchQuery rq = new SpanRelationMatchQuery(srq, sfq2, scq2,
                 true);
 
@@ -159,8 +162,8 @@
 
         SpanFocusQuery sfq3 = new SpanFocusQuery(ref, (byte) 1);
         // vp -> nn
-        SpanRelationMatchQuery rq2 = new SpanRelationMatchQuery(srq, sfq3,
-                scq3, true);
+        SpanRelationMatchQuery rq2 = new SpanRelationMatchQuery(srq, sfq3, scq3,
+                true);
 
         SpanReferenceQuery ref2 = new SpanReferenceQuery(rq2, (byte) 3, true);
 
@@ -185,8 +188,9 @@
         ki.addDoc(createFieldDoc0());
         ki.commit();
 
-        String filepath = getClass().getResource(
-                "/queries/reference/distance-multiple-references.jsonld")
+        String filepath = getClass()
+                .getResource(
+                        "/queries/reference/distance-multiple-references.jsonld")
                 .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
@@ -224,8 +228,9 @@
         ki.addDoc(createFieldDoc1());
         ki.commit();
 
-        String filepath = getClass().getResource(
-                "/queries/reference/distance-reference.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/reference/distance-reference.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
 
@@ -241,8 +246,7 @@
     public static FieldDocument createFieldDoc1 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
-        fd.addTV(
-                "tokens",
+        fd.addTV("tokens",
                 "Frankenstein, treat my daughter well. She is the one that saved your master who you hold so dear.",
 
                 "[(0-12)s:Frankenstein|_0$<i>0<i>12|"
@@ -276,8 +280,7 @@
     public static FieldDocument createFieldDoc0 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
-        fd.addTV(
-                "tokens",
+        fd.addTV("tokens",
                 "Frankenstein, treat my daughter well. She is the one that saved your master who you hold so dear.",
 
                 "[(0-12)s:Frankenstein|_0$<i>0<i>12|"
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java
index 9bda6d1..46580ee 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRegexWildcardIndex.java
@@ -22,8 +22,7 @@
 
         // abcabcabac
         FieldDocument fd = new FieldDocument();
-        fd.addTV(
-                "base",
+        fd.addTV("base",
                 "affe afffe baum baumgarten steingarten franz hans haus efeu effe",
                 "[(0-4)s:affe|_0$<i>0<i>4|-:t$<i>10]"
                         + "[(5-10)s:afffe|_1$<i>5<i>10]"
@@ -41,48 +40,48 @@
 
         QueryBuilder kq = new QueryBuilder("base");
         SpanQueryWrapper sqw = kq.re("s:af*e");
-        assertEquals("SpanMultiTermQueryWrapper(base:/s:af*e/)", sqw.toQuery()
-                .toString());
+        assertEquals("SpanMultiTermQueryWrapper(base:/s:af*e/)",
+                sqw.toQuery().toString());
 
         Krill ks = _newKrill(sqw);
 
         Result kr = ki.search(ks);
         assertEquals((long) 2, kr.getTotalResults());
         assertEquals("[[affe]] afffe ...", kr.getMatch(0).getSnippetBrackets());
-        assertEquals("affe [[afffe]] baum ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("affe [[afffe]] baum ...",
+                kr.getMatch(1).getSnippetBrackets());
 
         ks = _newKrill(new QueryBuilder("base").re("s:baum.*"));
         kr = ki.search(ks);
 
         assertEquals((long) 2, kr.getTotalResults());
-        assertEquals("... afffe [[baum]] baumgarten ...", kr.getMatch(0)
-                .getSnippetBrackets());
-        assertEquals("... baum [[baumgarten]] steingarten ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("... afffe [[baum]] baumgarten ...",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("... baum [[baumgarten]] steingarten ...",
+                kr.getMatch(1).getSnippetBrackets());
 
         ks = _newKrill(new QueryBuilder("base").re("s:.....?garten"));
         kr = ki.search(ks);
         assertEquals((long) 2, kr.getTotalResults());
-        assertEquals("... baum [[baumgarten]] steingarten ...", kr.getMatch(0)
-                .getSnippetBrackets());
-        assertEquals("... baumgarten [[steingarten]] franz ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("... baum [[baumgarten]] steingarten ...",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("... baumgarten [[steingarten]] franz ...",
+                kr.getMatch(1).getSnippetBrackets());
 
         ks = _newKrill(new QueryBuilder("base").re("s:ha.s"));
         kr = ki.search(ks);
         assertEquals((long) 2, kr.getTotalResults());
-        assertEquals("... franz [[hans]] haus ...", kr.getMatch(0)
-                .getSnippetBrackets());
-        assertEquals("... hans [[haus]] efeu ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("... franz [[hans]] haus ...",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("... hans [[haus]] efeu ...",
+                kr.getMatch(1).getSnippetBrackets());
 
         ks = _newKrill(new QueryBuilder("base").re("s:.*ff.*"));
         kr = ki.search(ks);
         assertEquals((long) 3, kr.getTotalResults());
         assertEquals("[[affe]] afffe ...", kr.getMatch(0).getSnippetBrackets());
-        assertEquals("affe [[afffe]] baum ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("affe [[afffe]] baum ...",
+                kr.getMatch(1).getSnippetBrackets());
         assertEquals("... efeu [[effe]]", kr.getMatch(2).getSnippetBrackets());
     };
 
@@ -93,8 +92,7 @@
 
         // abcabcabac
         FieldDocument fd = new FieldDocument();
-        fd.addTV(
-                "base",
+        fd.addTV("base",
                 "affe afffe baum baumgarten steingarten franz hans haus efeu effe",
                 "[(0-4)s:affe|_0$<i>0<i>4|-:t$<i>10]"
                         + "[(5-10)s:afffe|_1$<i>5<i>10]"
@@ -112,16 +110,16 @@
 
         QueryBuilder kq = new QueryBuilder("base");
         SpanQueryWrapper sq = kq.wc("s:af*e");
-        assertEquals("SpanMultiTermQueryWrapper(base:s:af*e)", sq.toQuery()
-                .toString());
+        assertEquals("SpanMultiTermQueryWrapper(base:s:af*e)",
+                sq.toQuery().toString());
 
         Krill ks = _newKrill(sq);
 
         Result kr = ki.search(ks);
         assertEquals((long) 2, kr.getTotalResults());
         assertEquals("[[affe]] afffe ...", kr.getMatch(0).getSnippetBrackets());
-        assertEquals("affe [[afffe]] baum ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("affe [[afffe]] baum ...",
+                kr.getMatch(1).getSnippetBrackets());
 
         ks = _newKrill(new QueryBuilder("base").wc("s:baum.*"));
         kr = ki.search(ks);
@@ -131,26 +129,26 @@
         ks = _newKrill(new QueryBuilder("base").wc("s:baum*"));
         kr = ki.search(ks);
         assertEquals((long) 2, kr.getTotalResults());
-        assertEquals("... afffe [[baum]] baumgarten ...", kr.getMatch(0)
-                .getSnippetBrackets());
-        assertEquals("... baum [[baumgarten]] steingarten ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("... afffe [[baum]] baumgarten ...",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("... baum [[baumgarten]] steingarten ...",
+                kr.getMatch(1).getSnippetBrackets());
 
         ks = _newKrill(new QueryBuilder("base").wc("s:*garten"));
         kr = ki.search(ks);
         assertEquals((long) 2, kr.getTotalResults());
-        assertEquals("... baum [[baumgarten]] steingarten ...", kr.getMatch(0)
-                .getSnippetBrackets());
-        assertEquals("... baumgarten [[steingarten]] franz ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("... baum [[baumgarten]] steingarten ...",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("... baumgarten [[steingarten]] franz ...",
+                kr.getMatch(1).getSnippetBrackets());
 
         ks = _newKrill(new QueryBuilder("base").wc("s:ha?s"));
         kr = ki.search(ks);
         assertEquals((long) 2, kr.getTotalResults());
-        assertEquals("... franz [[hans]] haus ...", kr.getMatch(0)
-                .getSnippetBrackets());
-        assertEquals("... hans [[haus]] efeu ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("... franz [[hans]] haus ...",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("... hans [[haus]] efeu ...",
+                kr.getMatch(1).getSnippetBrackets());
 
         ks = _newKrill(new QueryBuilder("base").wc("s:?ff?"));
         kr = ki.search(ks);
@@ -166,8 +164,7 @@
 
         // abcabcabac
         FieldDocument fd = new FieldDocument();
-        fd.addTV(
-                "base",
+        fd.addTV("base",
                 "AfFe aFfFE Baum Baumgarten SteinGarten franZ HaNs Haus Efeu effe",
                 "[(0-4)s:AfFe|i:affe|_0$<i>0<i>4|-:t$<i>10]"
                         + "[(5-10)s:aFfFE|i:afffe|_1$<i>5<i>10]"
@@ -185,15 +182,15 @@
 
         QueryBuilder kq = new QueryBuilder("base");
         SpanQueryWrapper sqw = kq.re("s:Af*e", true);
-        assertEquals("SpanMultiTermQueryWrapper(base:/i:af*e/)", sqw.toQuery()
-                .toString());
+        assertEquals("SpanMultiTermQueryWrapper(base:/i:af*e/)",
+                sqw.toQuery().toString());
 
         Krill ks = _newKrill(sqw);
         Result kr = ki.search(ks);
         assertEquals((long) 2, kr.getTotalResults());
         assertEquals("[[AfFe]] aFfFE ...", kr.getMatch(0).getSnippetBrackets());
-        assertEquals("AfFe [[aFfFE]] Baum ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("AfFe [[aFfFE]] Baum ...",
+                kr.getMatch(1).getSnippetBrackets());
 
         ks = _newKrill(new QueryBuilder("base").re("s:Af.*e"));
         kr = ki.search(ks);
@@ -203,39 +200,39 @@
         ks = _newKrill(new QueryBuilder("base").re("s:baum.*", true));
         kr = ki.search(ks);
         assertEquals((long) 2, kr.getTotalResults());
-        assertEquals("... aFfFE [[Baum]] Baumgarten ...", kr.getMatch(0)
-                .getSnippetBrackets());
-        assertEquals("... Baum [[Baumgarten]] SteinGarten ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("... aFfFE [[Baum]] Baumgarten ...",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("... Baum [[Baumgarten]] SteinGarten ...",
+                kr.getMatch(1).getSnippetBrackets());
 
         ks = _newKrill(new QueryBuilder("base").re("s:.*garten", true));
         kr = ki.search(ks);
         assertEquals((long) 2, kr.getTotalResults());
-        assertEquals("... Baum [[Baumgarten]] SteinGarten ...", kr.getMatch(0)
-                .getSnippetBrackets());
-        assertEquals("... Baumgarten [[SteinGarten]] franZ ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("... Baum [[Baumgarten]] SteinGarten ...",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("... Baumgarten [[SteinGarten]] franZ ...",
+                kr.getMatch(1).getSnippetBrackets());
 
         ks = _newKrill(new QueryBuilder("base").re("s:.*garten", false));
         kr = ki.search(ks);
         assertEquals((long) 1, kr.getTotalResults());
-        assertEquals("... Baum [[Baumgarten]] SteinGarten ...", kr.getMatch(0)
-                .getSnippetBrackets());
+        assertEquals("... Baum [[Baumgarten]] SteinGarten ...",
+                kr.getMatch(0).getSnippetBrackets());
 
         ks = _newKrill(new QueryBuilder("base").re("s:ha.s", true));
         kr = ki.search(ks);
         assertEquals((long) 2, kr.getTotalResults());
-        assertEquals("... franZ [[HaNs]] Haus ...", kr.getMatch(0)
-                .getSnippetBrackets());
-        assertEquals("... HaNs [[Haus]] Efeu ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("... franZ [[HaNs]] Haus ...",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("... HaNs [[Haus]] Efeu ...",
+                kr.getMatch(1).getSnippetBrackets());
 
         ks = _newKrill(new QueryBuilder("base").re("s:.*f*e", true));
         kr = ki.search(ks);
         assertEquals((long) 3, kr.getTotalResults());
         assertEquals("[[AfFe]] aFfFE ...", kr.getMatch(0).getSnippetBrackets());
-        assertEquals("AfFe [[aFfFE]] Baum ...", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("AfFe [[aFfFE]] Baum ...",
+                kr.getMatch(1).getSnippetBrackets());
         assertEquals("... Efeu [[effe]]", kr.getMatch(2).getSnippetBrackets());
     };
 
@@ -246,8 +243,7 @@
 
         // abcabcabac
         FieldDocument fd = new FieldDocument();
-        fd.addTV(
-                "base",
+        fd.addTV("base",
                 "affe afffe baum baumgarten steingarten franz hans haus efeu effe",
                 "[(0-4)s:affe|_0$<i>0<i>4|-:t$<i>10]"
                         + "[(5-10)s:afffe|_1$<i>5<i>10]"
@@ -276,8 +272,8 @@
 
         Result kr = ki.search(ks);
         assertEquals((long) 1, kr.getTotalResults());
-        assertEquals("[[affe afffe]] baum ...", kr.getMatch(0)
-                .getSnippetBrackets());
+        assertEquals("[[affe afffe]] baum ...",
+                kr.getMatch(0).getSnippetBrackets());
     };
 
 
@@ -287,8 +283,7 @@
 
         // abcabcabac
         FieldDocument fd = new FieldDocument();
-        fd.addTV(
-                "base",
+        fd.addTV("base",
                 "affe afffe baum baumgarten steingarten franz hans haus efeu effe",
                 "[(0-4)s:affe|_0$<i>0<i>4|-:t$<i>10]"
                         + "[(5-10)s:afffe|_1$<i>5<i>10]"
@@ -305,9 +300,10 @@
         ki.commit();
 
         QueryBuilder kq = new QueryBuilder("base");
-        SpanQuery sq = kq.contains(
-                kq.seq(kq.re("s:a.*e")).append(kq.re("s:af*e")),
-                kq.seg("s:affe")).toQuery();
+        SpanQuery sq = kq
+                .contains(kq.seq(kq.re("s:a.*e")).append(kq.re("s:af*e")),
+                        kq.seg("s:affe"))
+                .toQuery();
         assertEquals(
                 "spanContain(spanNext(SpanMultiTermQueryWrapper(base:/s:a.*e/), SpanMultiTermQueryWrapper(base:/s:af*e/)), base:s:affe)",
                 sq.toString());
@@ -317,8 +313,8 @@
 
         Result kr = ki.search(ks);
         assertEquals((long) 1, kr.getTotalResults());
-        assertEquals("[[affe afffe]] baum ...", kr.getMatch(0)
-                .getSnippetBrackets());
+        assertEquals("[[affe afffe]] baum ...",
+                kr.getMatch(0).getSnippetBrackets());
     };
 
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java
index a1d615d..63491a2 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRelationIndex.java
@@ -75,24 +75,20 @@
     public static FieldDocument createFieldDoc0 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
-        fd.addTV(
-                "base",
-                "ceccecdeed",
-                "[(0-1)s:c$<s>1|_0$<i>0<i>1"
-                        + "|>:xip/syntax-dep_rel$<b>32<i>6<s>1<s>1<s>0]"
-                        + "[(1-2)s:e$<s>1|_1$<i>1<i>2|"
-                        + "<:xip/syntax-dep_rel$<b>32<i>9<s>1<s>1<s>0|"
-                        + ">:xip/syntax-dep_rel$<b>32<i>4<s>1<s>1<s>0]"
-                        + "[(2-3)s:c|_2$<i>2<i>3]"
-                        + "[(3-4)s:c$<s>1|s:b$<s>2|_3$<i>3<i>4|<:xip/syntax-dep_rel$<b>32<i>9<s>1<s>1<s>0]"
-                        + "[(4-5)s:e$<s>1|s:d$<s>2|_4$<i>4<i>5|<:xip/syntax-dep_rel$<b>32<i>1<s>1<s>1<s>0]"
-                        + "[(5-6)s:c|_5$<i>5<i>6]"
-                        + "[(6-7)s:d$<s>1|_6$<i>6<i>7|<:xip/syntax-dep_rel$<b>32<i>1<s>1<s>1<s>0]"
-                        + "[(7-8)s:e|_7$<i>7<i>8]"
-                        + "[(8-9)s:e|s:b|_8$<i>8<i>9]"
-                        + "[(9-10)s:d$<s>1|_9$<i>9<i>10|"
-                        + ">:xip/syntax-dep_rel$<b>32<i>1<s>1<s>1<s>0|"
-                        + ">:xip/syntax-dep_rel$<b>32<i>3<s>1<s>1<s>0]");
+        fd.addTV("base", "ceccecdeed", "[(0-1)s:c$<s>1|_0$<i>0<i>1"
+                + "|>:xip/syntax-dep_rel$<b>32<i>6<s>1<s>1<s>0]"
+                + "[(1-2)s:e$<s>1|_1$<i>1<i>2|"
+                + "<:xip/syntax-dep_rel$<b>32<i>9<s>1<s>1<s>0|"
+                + ">:xip/syntax-dep_rel$<b>32<i>4<s>1<s>1<s>0]"
+                + "[(2-3)s:c|_2$<i>2<i>3]"
+                + "[(3-4)s:c$<s>1|s:b$<s>2|_3$<i>3<i>4|<:xip/syntax-dep_rel$<b>32<i>9<s>1<s>1<s>0]"
+                + "[(4-5)s:e$<s>1|s:d$<s>2|_4$<i>4<i>5|<:xip/syntax-dep_rel$<b>32<i>1<s>1<s>1<s>0]"
+                + "[(5-6)s:c|_5$<i>5<i>6]"
+                + "[(6-7)s:d$<s>1|_6$<i>6<i>7|<:xip/syntax-dep_rel$<b>32<i>1<s>1<s>1<s>0]"
+                + "[(7-8)s:e|_7$<i>7<i>8]" + "[(8-9)s:e|s:b|_8$<i>8<i>9]"
+                + "[(9-10)s:d$<s>1|_9$<i>9<i>10|"
+                + ">:xip/syntax-dep_rel$<b>32<i>1<s>1<s>1<s>0|"
+                + ">:xip/syntax-dep_rel$<b>32<i>3<s>1<s>1<s>0]");
         return fd;
     }
 
@@ -100,9 +96,7 @@
     public static FieldDocument createFieldDoc1 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
-        fd.addTV(
-                "base",
-                "ceccecdeed",
+        fd.addTV("base", "ceccecdeed",
                 "[(0-1)s:c$<s>2|<>:p$<b>64<i>0<i>3<i>3<b>0<s>1|_0$<i>0<i>1|"
                         + ">:xip/syntax-dep_rel$<b>35<i>0<i>1<i>1<i>2<i>3<i>6<i>9<s>1<s>1<s>2|"
                         + ">:xip/syntax-dep_rel$<b>33<i>1<i>2<i>6<i>9<s>2<s>1<s>0|"
@@ -116,8 +110,7 @@
                         + ">:xip/syntax-dep_rel$<b>34<i>3<i>4<i>9<i>9<s>1<s>1<s>0|"
                         + "<:xip/syntax-dep_rel$<b>35<i>3<i>4<i>4<i>5<i>9<i>1<i>3<s>1<s>1<s>2|"
                         + "<:xip/syntax-dep_rel$<b>34<i>5<i>6<i>9<i>1<s>1<s>2<s>0|"
-                        + "@:func=obj$<b>18<s>2]"
-                        + "[(7-8)s:e|_7$<i>7<i>8]"
+                        + "@:func=obj$<b>18<s>2]" + "[(7-8)s:e|_7$<i>7<i>8]"
                         + "[(8-9)s:e|s:b|_8$<i>8<i>9]"
                         + "[(9-10)s:d$<s>1|_9$<i>9<i>10|<"
                         + ":xip/syntax-dep_rel$<b>33<i>6<i>7<i>6<i>9<s>2<s>1<s>0]");
@@ -128,9 +121,7 @@
     public static FieldDocument createFieldDoc2 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
-        fd.addTV(
-                "base",
-                "Ich kaufe die Blümen für meine Mutter.",
+        fd.addTV("base", "Ich kaufe die Blümen für meine Mutter.",
                 "[(0-3)s:Ich|_0$<i>0<i>3|pos:NN$<s>1|<>:s$<b>64<i>0<i>38<i>7<b>0<s>2|<>:np$<b>64<i>0<i>3<i>1<b>0<s>3|"
                         + ">:child-of$<b>33<i>0<i>38<i>0<i>7<s>3<s>2<s>4|"
                         + ">:child-of$<b>33<i>0<i>3<i>0<i>1<s>1<s>3<s>0|"
@@ -203,15 +194,16 @@
 
     /**
      * Relations: token to token, token to span, span to span
-     * */
+     */
     @Test
     public void testCase1 () throws IOException {
         ki.addDoc(createFieldDoc0());
         ki.addDoc(createFieldDoc1());
         ki.commit();
 
-        SpanRelationQuery sq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", ">:xip/syntax-dep_rel")), true);
+        SpanRelationQuery sq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", ">:xip/syntax-dep_rel")),
+                true);
         kr = ki.search(sq, (short) 10);
 
         assertEquals((long) 7, kr.getTotalResults());
@@ -244,15 +236,16 @@
 
     /**
      * Relation span to token
-     * */
+     */
     @Test
     public void testCase2 () throws IOException {
         ki.addDoc(createFieldDoc0());
         ki.addDoc(createFieldDoc1());
         ki.commit();
 
-        SpanRelationQuery sq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", "<:xip/syntax-dep_rel")), true);
+        SpanRelationQuery sq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", "<:xip/syntax-dep_rel")),
+                true);
         kr = ki.search(sq, (short) 10);
 
         assertEquals((long) 7, kr.getTotalResults());
@@ -281,15 +274,15 @@
 
     /**
      * Relations only
-     * */
+     */
     @Test
     public void testCase3 () throws IOException {
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
         // child-of relations
-        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", ">:child-of")), true);
+        SpanRelationQuery srq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", ">:child-of")), true);
         kr = ki.search(srq, (short) 20);
 
         assertEquals((long) 13, kr.getTotalResults());
@@ -310,14 +303,14 @@
 
     /**
      * Relations only with/out attribute
-     * */
+     */
     @Test
     public void testCase4 () throws IOException {
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
-        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", ">:child-of")), true);
+        SpanRelationQuery srq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", ">:child-of")), true);
 
         SpanFocusQuery fq = new SpanFocusQuery(srq, srq.getTempClassNumbers());
         fq.setMatchTemporaryClass(true);
@@ -328,8 +321,8 @@
         // System.out.println(m.getStartPos() + " " + m.getEndPos());
         // }
 
-        SpanAttributeQuery saq = new SpanAttributeQuery(new SpanTermQuery(
-                new Term("base", "@:func=sbj")), true);
+        SpanAttributeQuery saq = new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:func=sbj")), true);
         // kr = ki.search(saq, (short) 20);
 
         // child-of with attr func=sbj
@@ -341,8 +334,10 @@
         // assertEquals(7, kr.getMatch(0).getEndPos());
 
         // child-of without attr func=sbj
-        wq = new SpanWithAttributeQuery(fq, new SpanAttributeQuery(
-                new SpanTermQuery(new Term("base", "@:func=sbj")), true, true),
+        wq = new SpanWithAttributeQuery(fq,
+                new SpanAttributeQuery(
+                        new SpanTermQuery(new Term("base", "@:func=sbj")), true,
+                        true),
                 true);
         kr = ki.search(wq, (short) 20);
         assertEquals((long) 12, kr.getTotalResults());
@@ -352,7 +347,7 @@
     /**
      * Relation directions <br/>
      * Relation with specific sources, return the sources
-     * */
+     */
     @Test
     public void testCase6 () throws IOException {
         ki.addDoc(createFieldDoc2());
@@ -362,8 +357,8 @@
         SpanElementQuery seq1 = new SpanElementQuery("base", "np");
         SpanClassQuery scq1 = new SpanClassQuery(seq1, (byte) 1);
 
-        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", ">:child-of")), true);
+        SpanRelationQuery srq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", ">:child-of")), true);
 
         SpanRelationMatchQuery rm = new SpanRelationMatchQuery(srq, scq1, true);
         SpanFocusQuery rv = new SpanFocusQuery(rm, (byte) 1);
@@ -386,8 +381,8 @@
         assertEquals(7, kr.getMatch(3).getEndPos());
 
         // return all parents that are NP
-        srq = new SpanRelationQuery(new SpanTermQuery(new Term("base",
-                "<:child-of")), true);
+        srq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", "<:child-of")), true);
         rm = new SpanRelationMatchQuery(srq, scq1, true);
         rv = new SpanFocusQuery(rm, (byte) 1);
         kr = ki.search(rv, (short) 10);
@@ -412,15 +407,15 @@
 
     /**
      * Dependency relations with attribute
-     * */
+     */
     @Test
     public void testCase5 () throws IOException {
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
         // target of a dependency relation
-        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", "<:dep")), true);
+        SpanRelationQuery srq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", "<:dep")), true);
         kr = ki.search(srq, (short) 10);
         assertEquals((long) 6, kr.getTotalResults());
 
@@ -432,8 +427,8 @@
         kr = ki.search(fq, (short) 10);
         assertEquals((long) 6, kr.getTotalResults());
 
-        SpanAttributeQuery aq = new SpanAttributeQuery(new SpanTermQuery(
-                new Term("base", "@:func=head")), true);
+        SpanAttributeQuery aq = new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:func=head")), true);
         kr = ki.search(aq, (short) 10);
 
         // dependency relation, which is also a head
@@ -452,7 +447,7 @@
 
     /**
      * Relation with specific sources, return any targets
-     * */
+     */
     @Test
     public void testCase7 () throws IOException {
         ki.addDoc(createFieldDoc2());
@@ -462,8 +457,8 @@
         SpanElementQuery seq1 = new SpanElementQuery("base", "np");
         SpanClassQuery scq1 = new SpanClassQuery(seq1, (byte) 1);
 
-        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", ">:child-of")), true);
+        SpanRelationQuery srq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", ">:child-of")), true);
         srq.setTargetClass((byte) 2);
 
         SpanRelationMatchQuery rm = new SpanRelationMatchQuery(srq, scq1, true);
@@ -498,7 +493,7 @@
     /**
      * Relations whose source/target do not embed
      * its counterparts.
-     * */
+     */
     @Test
     public void testCase8 () throws IOException {
         ki.addDoc(createFieldDoc2());
@@ -506,10 +501,10 @@
 
         //return source of dep relations to pos:NN
 
-        SpanTermWithIdQuery tq = new SpanTermWithIdQuery(new Term("base",
-                "pos:NN"), true);
-        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", "<:dep")), true);
+        SpanTermWithIdQuery tq = new SpanTermWithIdQuery(
+                new Term("base", "pos:NN"), true);
+        SpanRelationQuery srq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", "<:dep")), true);
         srq.setSourceClass((byte) 1);
         SpanRelationMatchQuery rm = new SpanRelationMatchQuery(srq, tq, true);
         SpanQuery rv = new SpanFocusQuery(rm, (byte) 1);
@@ -549,7 +544,7 @@
      * Relation with specific sources and targets, return the sources
      * 
      * @throws IOException
-     * */
+     */
     @Test
     public void testCase9 () throws IOException {
         ki.addDoc(createFieldDoc2());
@@ -558,8 +553,8 @@
         // return all children of np
         SpanElementQuery seq1 = new SpanElementQuery("base", "np");
         SpanClassQuery scq1 = new SpanClassQuery(seq1, (byte) 1);
-        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", "<:child-of")), true);
+        SpanRelationQuery srq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", "<:child-of")), true);
         srq.setSourceClass((byte) 2);
         SpanRelationMatchQuery rm = new SpanRelationMatchQuery(srq, scq1, true);
         SpanFocusQuery rv = new SpanFocusQuery(rm, (byte) 2);
@@ -594,14 +589,14 @@
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
-        SpanTermWithIdQuery tiq = new SpanTermWithIdQuery(new Term("base",
-                "pos:ART"), true);
+        SpanTermWithIdQuery tiq = new SpanTermWithIdQuery(
+                new Term("base", "pos:ART"), true);
         SpanClassQuery scq1 = new SpanClassQuery(tiq, (byte) 1);
         SpanElementQuery seq = new SpanElementQuery("base", "np");
         SpanClassQuery scq2 = new SpanClassQuery(seq, (byte) 2);
 
-        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", ">:child-of")), true);
+        SpanRelationQuery srq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", ">:child-of")), true);
         srq.setSourceClass((byte) 1);
         srq.setTargetClass((byte) 2);
 
@@ -630,8 +625,8 @@
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
-        SpanTermWithIdQuery tiq = new SpanTermWithIdQuery(new Term("base",
-                "pos:ART"), true);
+        SpanTermWithIdQuery tiq = new SpanTermWithIdQuery(
+                new Term("base", "pos:ART"), true);
         SpanClassQuery scq1 = new SpanClassQuery(tiq, (byte) 1);
 
         kr = ki.search(scq1, (short) 10);
@@ -641,8 +636,8 @@
         assertEquals(5, kr.getMatch(1).getStartPos());
         assertEquals(6, kr.getMatch(1).getEndPos());
 
-        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", ">:child-of")), true);
+        SpanRelationQuery srq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", ">:child-of")), true);
         srq.setSourceClass((byte) 1);
         srq.setTargetClass((byte) 2);
 
@@ -721,19 +716,19 @@
     /**
      * Relation whose nodes have a specific attribute.
      * 
-     * */
+     */
     @Test
     public void testCase10a () throws IOException {
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
-        SpanAttributeQuery aq = new SpanAttributeQuery(new SpanTermQuery(
-                new Term("base", "@:case=accusative")), true);
+        SpanAttributeQuery aq = new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:case=accusative")), true);
         kr = ki.search(aq, (short) 10);
         assertEquals((long) 3, kr.getTotalResults());
 
-        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", ">:child-of")), true);
+        SpanRelationQuery srq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", ">:child-of")), true);
         srq.setSourceClass((byte) 1);
         srq.setTargetClass((byte) 2);
         kr = ki.search(srq, (short) 20);
@@ -741,7 +736,8 @@
 
         // Matching relation source node with an attribute
         SpanFocusQuery sfq1 = new SpanFocusQuery(srq, (byte) 1);
-        SpanWithAttributeQuery swaq = new SpanWithAttributeQuery(sfq1, aq, true);
+        SpanWithAttributeQuery swaq = new SpanWithAttributeQuery(sfq1, aq,
+                true);
 
         kr = ki.search(swaq, (short) 10);
         assertEquals((long) 2, kr.getTotalResults());
@@ -751,12 +747,15 @@
         assertEquals(7, kr.getMatch(1).getEndPos());
 
         // Returning relations whose source has a specific attribute
-        SpanFocusQuery fqr = new SpanFocusQuery(swaq, srq.getTempClassNumbers());
+        SpanFocusQuery fqr = new SpanFocusQuery(swaq,
+                srq.getTempClassNumbers());
         fqr.setMatchTemporaryClass(true);
         fqr.setRemoveTemporaryClasses(true);
-        assertEquals("focus(#[1,2]spanRelationWithAttribute(focus(1: "
-                + "{1: source:{2: target:spanRelation(base:>:child-of)}}), "
-                + "spanAttribute(base:@:case=accusative)))", fqr.toString());
+        assertEquals(
+                "focus(#[1,2]spanRelationWithAttribute(focus(1: "
+                        + "{1: source:{2: target:spanRelation(base:>:child-of)}}), "
+                        + "spanAttribute(base:@:case=accusative)))",
+                fqr.toString());
 
         kr = ki.search(fqr, (short) 10);
         assertEquals((long) 2, kr.getTotalResults());
@@ -799,19 +798,19 @@
     /**
      * Relation whose nodes have a specific attribute. Alternative
      * query (actually used in serialization)
-     * */
+     */
     @Test
     public void testCase10b () throws IOException {
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
-        SpanAttributeQuery aq = new SpanAttributeQuery(new SpanTermQuery(
-                new Term("base", "@:case=accusative")), true);
+        SpanAttributeQuery aq = new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:case=accusative")), true);
         kr = ki.search(aq, (short) 10);
         assertEquals((long) 3, kr.getTotalResults());
 
-        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", ">:child-of")), true);
+        SpanRelationQuery srq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", ">:child-of")), true);
         srq.setSourceClass((byte) 1);
         srq.setTargetClass((byte) 2);
         kr = ki.search(srq, (short) 20);
@@ -868,24 +867,24 @@
 
     /**
      * Matching both relation nodes whose a specific attribute
-     * */
+     */
     @Test
     public void testCase11 () throws IOException {
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
-        SpanAttributeQuery aq = new SpanAttributeQuery(new SpanTermQuery(
-                new Term("base", "@:case=accusative")), true);
+        SpanAttributeQuery aq = new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:case=accusative")), true);
         kr = ki.search(aq, (short) 10);
         assertEquals((long) 3, kr.getTotalResults());
 
-        SpanAttributeQuery aq2 = new SpanAttributeQuery(new SpanTermQuery(
-                new Term("base", "@:case=accusative")), true);
+        SpanAttributeQuery aq2 = new SpanAttributeQuery(
+                new SpanTermQuery(new Term("base", "@:case=accusative")), true);
         kr = ki.search(aq2, (short) 10);
         assertEquals((long) 3, kr.getTotalResults());
 
-        SpanRelationQuery srq = new SpanRelationQuery(new SpanTermQuery(
-                new Term("base", ">:child-of")), true);
+        SpanRelationQuery srq = new SpanRelationQuery(
+                new SpanTermQuery(new Term("base", ">:child-of")), true);
         srq.setSourceClass((byte) 1);
         srq.setTargetClass((byte) 2);
         kr = ki.search(srq, (short) 20);
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java
index fd6b3b3..3cbc34f 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestRepetitionIndex.java
@@ -25,16 +25,16 @@
     private FieldDocument createFieldDoc0 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
-        fd.addTV("base", "text", "[(0-1)s:c|_1$<i>0<i>1]"
-                + "[(1-2)s:e|_2$<i>1<i>2]"
-                + "[(2-3)s:c|_3$<i>2<i>3|<>:y$<b>64<i>2<i>4<i>4<b>0]"
-                + "[(3-4)s:c|s:b|_4$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7<b>0]"
-                + "[(4-5)s:e|s:d|_5$<i>4<i>5|<>:y$<b>64<i>4<i>6<i>6<b>0]"
-                + "[(5-6)s:c|_6$<i>5<i>6|<>:y$<b>64<i>5<i>8<i>8]"
-                + "[(6-7)s:d|_7$<i>6<i>7<b>0]"
-                + "[(7-8)s:e|_8$<i>7<i>8|<>:x$<b>64<i>7<i>9<i>9<b>0]"
-                + "[(8-9)s:e|s:b|_9$<i>8<i>9|<>:x$<b>64<i>8<i>10<i>10<b>0]"
-                + "[(9-10)s:d|_10$<i>9<i>10]");
+        fd.addTV("base", "text",
+                "[(0-1)s:c|_1$<i>0<i>1]" + "[(1-2)s:e|_2$<i>1<i>2]"
+                        + "[(2-3)s:c|_3$<i>2<i>3|<>:y$<b>64<i>2<i>4<i>4<b>0]"
+                        + "[(3-4)s:c|s:b|_4$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7<b>0]"
+                        + "[(4-5)s:e|s:d|_5$<i>4<i>5|<>:y$<b>64<i>4<i>6<i>6<b>0]"
+                        + "[(5-6)s:c|_6$<i>5<i>6|<>:y$<b>64<i>5<i>8<i>8]"
+                        + "[(6-7)s:d|_7$<i>6<i>7<b>0]"
+                        + "[(7-8)s:e|_8$<i>7<i>8|<>:x$<b>64<i>7<i>9<i>9<b>0]"
+                        + "[(8-9)s:e|s:b|_9$<i>8<i>9|<>:x$<b>64<i>8<i>10<i>10<b>0]"
+                        + "[(9-10)s:d|_10$<i>9<i>10]");
         return fd;
     }
 
@@ -77,12 +77,13 @@
         return fd;
     }
 
-    @Test    
+
+    @Test
     public void testTermQuery () throws IOException {
         ki = new KrillIndex();
         ki.addDoc(createFieldDoc0());
         ki.commit();
-        
+
         // Quantifier only
         // c{1,2}
         SpanQuery sq = new SpanRepetitionQuery(
@@ -101,9 +102,10 @@
         assertEquals(5, kr.getMatch(4).getStartPos());
         assertEquals(6, kr.getMatch(4).getEndPos());
     }
-    
+
+
     @Test
-    public void testRepetitionInSequences() throws IOException {
+    public void testRepetitionInSequences () throws IOException {
         ki = new KrillIndex();
         ki.addDoc(createFieldDoc0());
         ki.commit();
@@ -111,8 +113,9 @@
         SpanQuery sq, sq2;
         // ec{1,2}
         sq = new SpanNextQuery(new SpanTermQuery(new Term("base", "s:e")),
-                new SpanRepetitionQuery(new SpanTermQuery(new Term("base",
-                        "s:c")), 1, 2, true));
+                new SpanRepetitionQuery(
+                        new SpanTermQuery(new Term("base", "s:c")), 1, 2,
+                        true));
 
         kr = ki.search(sq, (short) 10);
         // 1-3, 1-4, 4-6
@@ -140,17 +143,18 @@
         assertEquals((long) 5, kr.getTotalResults());
     }
 
+
     @Test
-    public void testMinZeroRepetition() throws IOException {
-    	ki = new KrillIndex();
+    public void testMinZeroRepetition () throws IOException {
+        ki = new KrillIndex();
         ki.addDoc(createFieldDoc0());
         ki.commit();
-    	
-        SpanQuery sq, sq2;    	
-    	sq = new SpanTermQuery(new Term("base", "s:e"));
-    	kr = ki.search(sq, (short) 10);
-    	
-    	assertEquals((long) 4, kr.getTotalResults());
+
+        SpanQuery sq, sq2;
+        sq = new SpanTermQuery(new Term("base", "s:e"));
+        kr = ki.search(sq, (short) 10);
+
+        assertEquals((long) 4, kr.getTotalResults());
         assertEquals(1, kr.getMatch(0).getStartPos());
         assertEquals(2, kr.getMatch(0).getEndPos());
         assertEquals(4, kr.getMatch(1).getStartPos());
@@ -159,18 +163,17 @@
         assertEquals(8, kr.getMatch(2).getEndPos());
         assertEquals(8, kr.getMatch(3).getStartPos());
         assertEquals(9, kr.getMatch(3).getEndPos());
-
-        sq2 = new SpanNextQuery(sq,
-                new SpanRepetitionQuery(new SpanTermQuery(new Term("base",
-                        "s:c")), 0, 1, true));
-
-        kr = ki.search(sq2, (short) 10);
-        for (Match km : kr.getMatches()){
-	     	//System.out.println(km.getSnippetBrackets());
-	     	System.out.println(km.getStartPos() +","+km.getEndPos());
-	     }
+        try {
+            sq2 = new SpanNextQuery(sq, new SpanRepetitionQuery(
+                    new SpanTermQuery(new Term("base", "s:c")), 0, 1, true));
+        }
+        catch (IllegalArgumentException e) {
+            assertEquals("Minimum repetition must not lower than 1.",
+                    e.getMessage());
+        }
     }
 
+
     /** Skip to */
     @Test
     public void testCase2 () throws IOException {
@@ -191,8 +194,9 @@
 
         // ec{2,2}
         sq = new SpanNextQuery(new SpanTermQuery(new Term("base", "s:e")),
-                new SpanRepetitionQuery(new SpanTermQuery(new Term("base",
-                        "s:c")), 2, 2, true));
+                new SpanRepetitionQuery(
+                        new SpanTermQuery(new Term("base", "s:c")), 2, 2,
+                        true));
 
         kr = ki.search(sq, (short) 10);
         assertEquals((long) 2, kr.getTotalResults());
@@ -211,10 +215,11 @@
         SpanQuery sq, sq2;
         // ec{1,2}
         sq = new SpanNextQuery(new SpanTermQuery(new Term("base", "s:e")),
-                new SpanOrQuery(new SpanRepetitionQuery(new SpanTermQuery(
-                        new Term("base", "s:c")), 1, 1, true),
-                        new SpanRepetitionQuery(new SpanTermQuery(new Term(
-                                "base", "s:b")), 1, 1, true)));
+                new SpanOrQuery(new SpanRepetitionQuery(
+                        new SpanTermQuery(new Term("base", "s:c")), 1, 1, true),
+                        new SpanRepetitionQuery(
+                                new SpanTermQuery(new Term("base", "s:b")), 1,
+                                1, true)));
         kr = ki.search(sq, (short) 10);
         assertEquals((long) 3, kr.getTotalResults());
         assertEquals(1, kr.getMatch(0).startPos);
@@ -235,14 +240,14 @@
 
         SpanQuery sq;
         // c{2,2}
-        sq = new SpanRepetitionQuery(
-                new SpanTermQuery(new Term("base", "s:c")), 1, 3, true);
+        sq = new SpanRepetitionQuery(new SpanTermQuery(new Term("base", "s:c")),
+                1, 3, true);
         kr = ki.search(sq, (short) 10);
         // 2-3, 2-4, 2-5, 3-4, 3-5, 3-6, 4-5, 4-6, 5-6, 7-8  
         assertEquals((long) 10, kr.getTotalResults());
 
-        sq = new SpanRepetitionQuery(
-                new SpanTermQuery(new Term("base", "s:c")), 2, 3, true);
+        sq = new SpanRepetitionQuery(new SpanTermQuery(new Term("base", "s:c")),
+                2, 3, true);
         kr = ki.search(sq, (short) 10);
         // 2-4, 2-5, 3-5, 3-6, 4-6 
         assertEquals((long) 5, kr.getTotalResults());
@@ -266,8 +271,8 @@
 
         SpanQuery sq0, sq1, sq2;
         sq0 = new SpanTermQuery(new Term("tokens", "tt/p:NN"));
-        sq1 = new SpanRepetitionQuery(new SpanTermQuery(new Term("tokens",
-                "tt/p:ADJA")), 2, 3, true);
+        sq1 = new SpanRepetitionQuery(
+                new SpanTermQuery(new Term("tokens", "tt/p:ADJA")), 2, 3, true);
         sq2 = new SpanNextQuery(sq1, sq0);
         kr = ki.search(sq2, (short) 10);
 
@@ -276,10 +281,10 @@
         assertEquals(77, kr.getMatch(0).getEndPos());
         assertEquals(74, kr.getMatch(1).getStartPos());
         assertEquals(77, kr.getMatch(1).getEndPos());
-        
 
-        sq2 = new SpanNextQuery(new SpanTermQuery(new Term("tokens",
-                "s:offenen")), sq2);
+
+        sq2 = new SpanNextQuery(
+                new SpanTermQuery(new Term("tokens", "s:offenen")), sq2);
         kr = ki.search(sq2, (short) 10);
 
         assertEquals((long) 1, kr.getTotalResults());
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestSegmentIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestSegmentIndex.java
index b0c1305..8497dd5 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestSegmentIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestSegmentIndex.java
@@ -103,7 +103,7 @@
     /**
      * Matching a SpanElementQuery and a SpanNextQuery
      * Multiple atomic indices
-     * */
+     */
     @Test
     public void testCase4 () throws IOException {
         //		log.trace("Testcase4");
@@ -157,8 +157,9 @@
     public void testcase6 () throws IOException {
         ki.addDoc(createFieldDoc4());
         ki.commit();
-        sq = new SpanNextQuery(new SpanSegmentQuery(new SpanTermQuery(new Term(
-                "base", "s:b")), new SpanTermQuery(new Term("base", "s:c"))),
+        sq = new SpanNextQuery(
+                new SpanSegmentQuery(new SpanTermQuery(new Term("base", "s:b")),
+                        new SpanTermQuery(new Term("base", "s:c"))),
                 new SpanTermQuery(new Term("base", "s:d")));
 
         kr = ki.search(sq, (short) 10);
@@ -204,9 +205,9 @@
     private FieldDocument createFieldDoc2 () {
         fd = new FieldDocument();
         fd.addString("ID", "doc-2");
-        fd.addTV("base", "bdb", "[(0-1)s:b|i:b|_1$<i>0<i>1]"
-                + "[(1-2)s:d|i:d|s:b|_2$<i>1<i>2]"
-                + "[(2-3)s:b|i:b|s:a|_3$<i>2<i>3]");
+        fd.addTV("base", "bdb",
+                "[(0-1)s:b|i:b|_1$<i>0<i>1]" + "[(1-2)s:d|i:d|s:b|_2$<i>1<i>2]"
+                        + "[(2-3)s:b|i:b|s:a|_3$<i>2<i>3]");
         return fd;
     }
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestSegmentNegationIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestSegmentNegationIndex.java
index 81a5ed6..1bd1dcd 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestSegmentNegationIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestSegmentNegationIndex.java
@@ -144,9 +144,9 @@
     private FieldDocument createFieldDoc2 () {
         fd = new FieldDocument();
         fd.addString("ID", "doc-2");
-        fd.addTV("tokens", "bdb", "[(0-1)s:b|i:b|_1$<i>0<i>1]"
-                + "[(1-2)s:d|i:d|s:b|_2$<i>1<i>2]"
-                + "[(2-3)s:b|i:b|s:a|_3$<i>2<i>3]");
+        fd.addTV("tokens", "bdb",
+                "[(0-1)s:b|i:b|_1$<i>0<i>1]" + "[(1-2)s:d|i:d|s:b|_2$<i>1<i>2]"
+                        + "[(2-3)s:b|i:b|s:a|_3$<i>2<i>3]");
         return fd;
     }
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
index 7af71f0..4562c37 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
@@ -42,7 +42,7 @@
 
     /**
      * Left and right expansions
-     * */
+     */
     @Test
     public void testCase1 () throws IOException {
 
@@ -83,7 +83,7 @@
     /**
      * Classnumber
      * Check the expansion offsets
-     * */
+     */
     @Test
     public void testCase2 () {
         byte classNumber = 1;
@@ -141,13 +141,13 @@
 
     /**
      * Right expansion with exclusion
-     * */
+     */
     @Test
     public void testCase3 () throws IOException {
         byte classNumber = 1;
         SpanTermQuery stq = new SpanTermQuery(new Term("tokens", "tt/p:NN"));
-        SpanTermQuery notQuery = new SpanTermQuery(new Term("tokens",
-                "s:Buchstabe"));
+        SpanTermQuery notQuery = new SpanTermQuery(
+                new Term("tokens", "s:Buchstabe"));
 
         SpanExpansionQuery seq = new SpanExpansionQuery(stq, notQuery, 2, 3, 0,
                 classNumber, true);
@@ -177,16 +177,16 @@
     /**
      * Left expansion with exclusion
      * No expansion
-     * */
+     */
     @Test
     public void testCase4 () throws IOException {
         byte classNumber = 1;
         SpanTermQuery stq = new SpanTermQuery(new Term("tokens", "tt/p:NN"));
-        SpanTermQuery notQuery = new SpanTermQuery(new Term("tokens",
-                "tt/p:ADJA"));
+        SpanTermQuery notQuery = new SpanTermQuery(
+                new Term("tokens", "tt/p:ADJA"));
 
-        SpanExpansionQuery seq = new SpanExpansionQuery(stq, notQuery, 0, 2,
-                -1, classNumber, true);
+        SpanExpansionQuery seq = new SpanExpansionQuery(stq, notQuery, 0, 2, -1,
+                classNumber, true);
         kr = ki.search(seq, (short) 10);
 
         assertEquals(6, kr.getMatch(0).getStartPos());
@@ -221,7 +221,7 @@
      * TODO: end => to be handled in rendering process
      * 
      * @throws IOException
-     * */
+     */
     @Test
     public void testCase5 () throws IOException {
         KrillIndex ki = new KrillIndex();
@@ -259,7 +259,7 @@
      * Expansion exclusion : multiple documents
      * 
      * @throws IOException
-     * */
+     */
     @Test
     public void testCase6 () throws IOException {
         KrillIndex ki = new KrillIndex();
@@ -289,15 +289,16 @@
 
     /**
      * Skip to
-     * */
+     */
     @Test
     public void testCase7 () throws IOException, QueryException {
         KrillIndex ki = new KrillIndex();
         ki.addDoc(getClass().getResourceAsStream("/wiki/00001.json.gz"), true);
         ki.addDoc(getClass().getResourceAsStream("/wiki/00002.json.gz"), true);
         ki.commit();
-        String jsonPath = URLDecoder.decode(getClass().getResource("/queries/poly3.json")
-                .getFile(),"UTF-8");
+        String jsonPath = URLDecoder.decode(
+                getClass().getResource("/queries/poly3.json").getFile(),
+                "UTF-8");
         String jsonQuery = readFile(jsonPath);
         SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonQuery);
 
@@ -322,7 +323,7 @@
      * Warning: This is not armoured by <base/s=t>!
      * 
      * @throws IOException
-     * */
+     */
     @Test
     public void testQueryRewriteBug () throws IOException {
         KrillIndex ki = new KrillIndex();
@@ -398,20 +399,20 @@
      * Query rewrite bug
      * 
      * @throws IOException
-     * */
+     */
     @Test
     public void testExpansionQueryBug3 () throws IOException, QueryException {
         KrillIndex ki = new KrillIndex();
         ki.addDoc(createFieldDoc3());
         ki.addDoc(createFieldDoc4());
         ki.commit();
-        String jsonPath = URLDecoder.decode(getClass().getResource("/queries/bugs/expansion_bug_3.jsonld")
-                .getFile(),"UTF-8");
+        String jsonPath = URLDecoder.decode(getClass()
+                .getResource("/queries/bugs/expansion_bug_3.jsonld").getFile(),
+                "UTF-8");
         String json = readFile(jsonPath);
         KrillQuery kq = new KrillQuery("base");
         SpanQuery sq = kq.fromKoral(json).toQuery();
-        assertEquals(
-                sq.toString(),
+        assertEquals(sq.toString(),
                 "focus(254: spanContain(<base:base/s:t />, {254: spanExpansion(base:s:c, []{0, 4}, right)}))");
 
         kr = ki.search(sq, (short) 10);
@@ -442,7 +443,8 @@
                         + "[(3-4)s:c|s:d|_3$<i>3<i>4]"
                         + "[(4-5)s:e|_4$<i>4<i>5]" + "[(5-6)s:c|_5$<i>5<i>6]"
                         + "[(6-7)s:d|_6$<i>6<i>7]" + "[(7-8)s:e|_7$<i>7<i>8]"
-                        + "[(8-9)s:e|_8$<i>8<i>9]" + "[(9-10)s:c|_9$<i>9<i>10]");
+                        + "[(8-9)s:e|_8$<i>8<i>9]"
+                        + "[(9-10)s:c|_9$<i>9<i>10]");
         return fd;
     }
 
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestSubSpanIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestSubSpanIndex.java
index 206628b..e0349db 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestSubSpanIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestSubSpanIndex.java
@@ -37,10 +37,10 @@
 
     @Test
     public void testCase1 () throws IOException {
-        SpanDistanceQuery sdq = new SpanDistanceQuery(new SpanTermQuery(
-                new Term("tokens", "tt/p:NN")), new SpanTermQuery(new Term(
-                "tokens", "tt/p:VAFIN")), new DistanceConstraint(5, 5, true,
-                false), true);
+        SpanDistanceQuery sdq = new SpanDistanceQuery(
+                new SpanTermQuery(new Term("tokens", "tt/p:NN")),
+                new SpanTermQuery(new Term("tokens", "tt/p:VAFIN")),
+                new DistanceConstraint(5, 5, true, false), true);
 
         SpanSubspanQuery ssq = new SpanSubspanQuery(sdq, 0, 2, true);
         kr = ki.search(ssq, (short) 10);
@@ -69,10 +69,10 @@
 
     @Test
     public void testCase2 () {
-        SpanDistanceQuery sdq = new SpanDistanceQuery(new SpanTermQuery(
-                new Term("tokens", "tt/p:NN")), new SpanTermQuery(new Term(
-                "tokens", "tt/p:VAFIN")), new DistanceConstraint(5, 5, true,
-                false), true);
+        SpanDistanceQuery sdq = new SpanDistanceQuery(
+                new SpanTermQuery(new Term("tokens", "tt/p:NN")),
+                new SpanTermQuery(new Term("tokens", "tt/p:VAFIN")),
+                new DistanceConstraint(5, 5, true, false), true);
 
         // the subspan length is longer than the span length
         SpanSubspanQuery ssq = new SpanSubspanQuery(sdq, 0, 7, true);
@@ -99,10 +99,10 @@
     // Length 0
     @Test
     public void testCase3 () {
-        SpanDistanceQuery sdq = new SpanDistanceQuery(new SpanTermQuery(
-                new Term("tokens", "tt/p:NN")), new SpanTermQuery(new Term(
-                "tokens", "tt/p:VAFIN")), new DistanceConstraint(5, 5, true,
-                false), true);
+        SpanDistanceQuery sdq = new SpanDistanceQuery(
+                new SpanTermQuery(new Term("tokens", "tt/p:NN")),
+                new SpanTermQuery(new Term("tokens", "tt/p:VAFIN")),
+                new DistanceConstraint(5, 5, true, false), true);
 
         SpanSubspanQuery ssq = new SpanSubspanQuery(sdq, 3, 0, true);
         kr = ki.search(ssq, (short) 10);
@@ -141,8 +141,8 @@
                         + "[(3-4)s:c|i:c|_2$<i>4<i>6]");
         ki.addDoc(fd);
         ki.commit();
-        SpanSubspanQuery ssq = new SpanSubspanQuery(new SpanElementQuery(
-                "base", "x"), -1, 1, true);
+        SpanSubspanQuery ssq = new SpanSubspanQuery(
+                new SpanElementQuery("base", "x"), -1, 1, true);
         kr = ki.search(ssq, (short) 10);
 
         /*        
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestUnorderedDistanceIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestUnorderedDistanceIndex.java
index b94dc60..e461522 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestUnorderedDistanceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestUnorderedDistanceIndex.java
@@ -28,16 +28,16 @@
     private FieldDocument createFieldDoc0 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-0");
-        fd.addTV("base", "text", "[(0-1)s:c|_1$<i>0<i>1]"
-                + "[(1-2)s:e|_2$<i>1<i>2]"
-                + "[(2-3)s:c|_3$<i>2<i>3|<>:y$<b>64<i>2<i>4<i>4<b>0]"
-                + "[(3-4)s:c|_4$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7<b>0]"
-                + "[(4-5)s:d|_5$<i>4<i>5|<>:y$<b>64<i>4<i>6<i>6<b>0]"
-                + "[(5-6)s:c|_6$<i>5<i>6|<>:y$<b>64<i>5<i>8<i>8<b>0]"
-                + "[(6-7)s:d|_7$<i>6<i>7]"
-                + "[(7-8)s:f|_8$<i>7<i>8|<>:x$<b>64<i>7<i>9<i>9<b>0]"
-                + "[(8-9)s:e|_9$<i>8<i>9|<>:x$<b>64<i>8<i>10<i>10<b>0]"
-                + "[(9-10)s:d|_10$<i>9<i>10]");
+        fd.addTV("base", "text",
+                "[(0-1)s:c|_1$<i>0<i>1]" + "[(1-2)s:e|_2$<i>1<i>2]"
+                        + "[(2-3)s:c|_3$<i>2<i>3|<>:y$<b>64<i>2<i>4<i>4<b>0]"
+                        + "[(3-4)s:c|_4$<i>3<i>4|<>:x$<b>64<i>3<i>7<i>7<b>0]"
+                        + "[(4-5)s:d|_5$<i>4<i>5|<>:y$<b>64<i>4<i>6<i>6<b>0]"
+                        + "[(5-6)s:c|_6$<i>5<i>6|<>:y$<b>64<i>5<i>8<i>8<b>0]"
+                        + "[(6-7)s:d|_7$<i>6<i>7]"
+                        + "[(7-8)s:f|_8$<i>7<i>8|<>:x$<b>64<i>7<i>9<i>9<b>0]"
+                        + "[(8-9)s:e|_9$<i>8<i>9|<>:x$<b>64<i>8<i>10<i>10<b>0]"
+                        + "[(9-10)s:d|_10$<i>9<i>10]");
         return fd;
     }
 
@@ -45,12 +45,13 @@
     private FieldDocument createFieldDoc1 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
-        fd.addTV("base", "text", "[(0-1)s:d|_1$<i>0<i>1]"
-                + "[(1-2)s:c|_2$<i>1<i>2]" + "[(2-3)s:e|_3$<i>2<i>3]"
-                + "[(3-4)s:e|_4$<i>3<i>4]" + "[(4-5)s:d|_5$<i>4<i>5]"
-                + "[(5-6)s:e|_6$<i>5<i>6]" + "[(6-7)s:e|_7$<i>6<i>7]"
-                + "[(7-8)s:c|_8$<i>7<i>8]" + "[(8-9)s:e|_9$<i>8<i>9]"
-                + "[(9-10)s:d|_10$<i>9<i>10]");
+        fd.addTV("base", "text",
+                "[(0-1)s:d|_1$<i>0<i>1]" + "[(1-2)s:c|_2$<i>1<i>2]"
+                        + "[(2-3)s:e|_3$<i>2<i>3]" + "[(3-4)s:e|_4$<i>3<i>4]"
+                        + "[(4-5)s:d|_5$<i>4<i>5]" + "[(5-6)s:e|_6$<i>5<i>6]"
+                        + "[(6-7)s:e|_7$<i>6<i>7]" + "[(7-8)s:c|_8$<i>7<i>8]"
+                        + "[(8-9)s:e|_9$<i>8<i>9]"
+                        + "[(9-10)s:d|_10$<i>9<i>10]");
         return fd;
     }
 
@@ -58,18 +59,20 @@
     private FieldDocument createFieldDoc2 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
-        fd.addTV("base", "text", "[(0-1)s:f|_1$<i>0<i>1]"
-                + "[(1-2)s:c|_2$<i>1<i>2]" + "[(2-3)s:e|_3$<i>2<i>3]"
-                + "[(3-4)s:e|_4$<i>3<i>4]" + "[(4-5)s:d|_5$<i>4<i>5]"
-                + "[(5-6)s:f|_6$<i>5<i>6]" + "[(6-7)s:f|_7$<i>6<i>7]");
+        fd.addTV("base", "text",
+                "[(0-1)s:f|_1$<i>0<i>1]" + "[(1-2)s:c|_2$<i>1<i>2]"
+                        + "[(2-3)s:e|_3$<i>2<i>3]" + "[(3-4)s:e|_4$<i>3<i>4]"
+                        + "[(4-5)s:d|_5$<i>4<i>5]" + "[(5-6)s:f|_6$<i>5<i>6]"
+                        + "[(6-7)s:f|_7$<i>6<i>7]");
         return fd;
     }
 
 
     private SpanQuery createQuery (String x, String y, int min, int max,
             boolean isOrdered) {
-        SpanQuery sq = new SpanDistanceQuery(new SpanTermQuery(new Term("base",
-                x)), new SpanTermQuery(new Term("base", y)),
+        SpanQuery sq = new SpanDistanceQuery(
+                new SpanTermQuery(new Term("base", x)),
+                new SpanTermQuery(new Term("base", y)),
                 new DistanceConstraint(min, max, isOrdered, false), true);
         return sq;
     }
@@ -78,8 +81,8 @@
     private SpanQuery createElementQuery (String x, String y, int min, int max,
             boolean isOrdered) {
         SpanQuery sq = new SpanDistanceQuery(new SpanElementQuery("base", x),
-                new SpanElementQuery("base", y), new DistanceConstraint(min,
-                        max, isOrdered, false), true);
+                new SpanElementQuery("base", y),
+                new DistanceConstraint(min, max, isOrdered, false), true);
         return sq;
     }
 
@@ -89,7 +92,7 @@
      * The first first and second spans are too far from each other
      * One of the spans ends first
      * One of the candidate list is empty
-     * */
+     */
     @Test
     public void testCase1 () throws IOException {
         //System.out.println("testcase 1");
@@ -113,7 +116,7 @@
      * the doc
      * 
      * @throws IOException
-     * */
+     */
     @Test
     public void testCase2 () throws IOException {
         //System.out.println("testcase 2");
@@ -134,7 +137,7 @@
      * Ensure same Doc
      * 
      * @throws IOException
-     * */
+     */
     @Test
     public void testCase3 () throws IOException {
         //System.out.println("testcase 3");
@@ -167,9 +170,8 @@
         ki.addDoc(createFieldDoc2());
         ki.commit();
 
-        SpanQuery sq = new SpanNextQuery(
-                createQuery("s:d", "s:e", 1, 2, false), new SpanTermQuery(
-                        new Term("base", "s:f")));
+        SpanQuery sq = new SpanNextQuery(createQuery("s:d", "s:e", 1, 2, false),
+                new SpanTermQuery(new Term("base", "s:f")));
 
         kr = ki.search(sq, (short) 10);
         assertEquals(kr.getTotalResults(), 2);
@@ -235,7 +237,7 @@
      * span query yields "redundant results" because matches are
      * searched for each
      * child span.
-     * */
+     */
     @Test
     public void testCase6 () throws IOException {
         ki = new KrillIndex();
@@ -252,7 +254,7 @@
 
     /**
      * Nested distance queries
-     * */
+     */
     @Test
     public void testCase7 () throws IOException {
         //System.out.println("testcase 7");
@@ -262,9 +264,9 @@
         ki.commit();
 
         SpanQuery sq = createQuery("s:c", "s:d", 1, 2, false);
-        SpanQuery sq2 = new SpanDistanceQuery(sq, new SpanTermQuery(new Term(
-                "base", "s:e")), new DistanceConstraint(1, 2, true, false),
-                true);
+        SpanQuery sq2 = new SpanDistanceQuery(sq,
+                new SpanTermQuery(new Term("base", "s:e")),
+                new DistanceConstraint(1, 2, true, false), true);
         kr = ki.search(sq2, (short) 10);
         assertEquals(kr.getTotalResults(), 3);
         assertEquals(5, kr.getMatch(0).getStartPos());
@@ -279,14 +281,15 @@
 
     /**
      * Multiple NextSpans in the same first span position
-     * */
+     */
     @Test
     public void testCase8 () throws IOException {
         ki = new KrillIndex();
         ki.addDoc(createFieldDoc1());
         ki.commit();
-        SpanQuery sq = new SpanNextQuery(new SpanTermQuery(new Term("base",
-                "s:d")), createQuery("s:c", "s:e", 1, 2, false));
+        SpanQuery sq = new SpanNextQuery(
+                new SpanTermQuery(new Term("base", "s:d")),
+                createQuery("s:c", "s:e", 1, 2, false));
         kr = ki.search(sq, (short) 10);
 
         assertEquals(kr.getTotalResults(), 3);
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestUnorderedElementDistanceIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestUnorderedElementDistanceIndex.java
index d3d1c4d..be79a11 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestUnorderedElementDistanceIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestUnorderedElementDistanceIndex.java
@@ -97,13 +97,14 @@
         SpanElementQuery e = new SpanElementQuery("base", elementType);
         return new SpanDistanceQuery(new SpanTermQuery(new Term("base", x)),
                 new SpanTermQuery(new Term("base", y)), new DistanceConstraint(
-                        e, minDistance, maxDistance, isOrdered, false), true);
+                        e, minDistance, maxDistance, isOrdered, false),
+                true);
     }
 
 
     /**
      * Only terms within an element are matched.
-     * */
+     */
     @Test
     public void testCase1 () throws IOException {
         //System.out.println("testCase1");
@@ -135,7 +136,7 @@
      * In the beginning, first and second spans are already too far
      * from each other
      * (one-list-empty case, both-list-empty-case).
-     * */
+     */
     @Test
     public void testCase2 () throws IOException {
         //System.out.println("testCase2");
@@ -162,7 +163,7 @@
 
     /**
      * Multiple occurrences in an element.
-     * */
+     */
     @Test
     public void testCase3 () throws IOException {
         //System.out.println("testCase3");
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestWPDIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestWPDIndex.java
index a9fd222..55c5f78 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestWPDIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestWPDIndex.java
@@ -37,8 +37,8 @@
     private SpanDistanceQuery createElementDistanceQuery (String e, String x,
             String y, int min, int max, boolean isOrdered, boolean exclusion) {
         SpanElementQuery eq = new SpanElementQuery("tokens", e);
-        SpanDistanceQuery sq = new SpanDistanceQuery(new SpanTermQuery(
-                new Term("tokens", x)),
+        SpanDistanceQuery sq = new SpanDistanceQuery(
+                new SpanTermQuery(new Term("tokens", x)),
                 new SpanTermQuery(new Term("tokens", y)),
                 new DistanceConstraint(eq, min, max, isOrdered, exclusion),
                 true);
@@ -48,8 +48,8 @@
 
     private SpanDistanceQuery createDistanceQuery (String x, String y, int min,
             int max, boolean isOrdered, boolean exclusion) {
-        SpanDistanceQuery sq = new SpanDistanceQuery(new SpanTermQuery(
-                new Term("tokens", x)),
+        SpanDistanceQuery sq = new SpanDistanceQuery(
+                new SpanTermQuery(new Term("tokens", x)),
                 new SpanTermQuery(new Term("tokens", y)),
                 new DistanceConstraint(min, max, isOrdered, exclusion), true);
         return sq;
@@ -192,21 +192,24 @@
     @Test
     public void testCase5 () throws IOException {
         SpanQuery sq;
-        sq = new SpanRepetitionQuery(new SpanTermQuery(new Term("tokens",
-                "mate/p:ADJA")), 1, 2, true);
+        sq = new SpanRepetitionQuery(
+                new SpanTermQuery(new Term("tokens", "mate/p:ADJA")), 1, 2,
+                true);
         ks = new Krill(sq);
         kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 4116416);
         //0.9s
 
-        sq = new SpanRepetitionQuery(new SpanTermQuery(new Term("tokens",
-                "mate/p:ADJA")), 1, 1, true);
+        sq = new SpanRepetitionQuery(
+                new SpanTermQuery(new Term("tokens", "mate/p:ADJA")), 1, 1,
+                true);
         ks = new Krill(sq);
         kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 3879671);
 
-        sq = new SpanRepetitionQuery(new SpanTermQuery(new Term("tokens",
-                "mate/p:ADJA")), 2, 2, true);
+        sq = new SpanRepetitionQuery(
+                new SpanTermQuery(new Term("tokens", "mate/p:ADJA")), 2, 2,
+                true);
         ks = new Krill(sq);
         kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 236745);
@@ -217,16 +220,18 @@
     /** Next and repetition */
     @Test
     public void testCase6 () throws IOException {
-        SpanQuery sq = new SpanNextQuery(new SpanTermQuery(new Term("tokens",
-                "tt/p:NN")), new SpanRepetitionQuery(new SpanTermQuery(
-                new Term("tokens", "mate/p:ADJA")), 2, 2, true));
+        SpanQuery sq = new SpanNextQuery(
+                new SpanTermQuery(new Term("tokens", "tt/p:NN")),
+                new SpanRepetitionQuery(
+                        new SpanTermQuery(new Term("tokens", "mate/p:ADJA")), 2,
+                        2, true));
         ks = new Krill(sq);
         kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 30223);
         // 1.1s
 
-        SpanQuery sq2 = new SpanNextQuery(sq, new SpanTermQuery(new Term(
-                "tokens", "tt/p:NN")));
+        SpanQuery sq2 = new SpanNextQuery(sq,
+                new SpanTermQuery(new Term("tokens", "tt/p:NN")));
         ks = new Krill(sq2);
         kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 26607);
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
index 7960560..ee35980 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestWithinIndex.java
@@ -289,10 +289,11 @@
         ki.addDoc(fd);
 
         fd = new FieldDocument();
-        fd.addTV("base", "x   y   z   h   ", "[(0-3)s:x]" +  // 1
-                "[(3-6)s:y]" +  // 2
-                "[(6-9)s:z]" +  // 3
-                "[(9-12)s:h]"); // 4
+        fd.addTV("base", "x   y   z   h   ",
+                "[(0-3)s:x]" +  // 1
+                        "[(3-6)s:y]" +  // 2
+                        "[(6-9)s:z]" +  // 3
+                        "[(9-12)s:h]"); // 4
         ki.addDoc(fd);
 
         // <a>x<a>y<a>zabc</a>abc</a>abc</a>
@@ -621,26 +622,16 @@
         fd.addTV("base", "h  h  i  j  h  i  j  h  i  j  h  h  ",
                 "[(0-3)s:h|<>:a$<b>64<i>0<i>15<i>4<b>0|"
                         + "<>:a$<b>64<i>0<i>18<i>6<b>0|"
-                        + "<>:a$<b>64<i>0<i>27<i>8<b>0|_0$<i>0<i>3]"
-                        + // 1
-                        "[(3-6)s:h|_1$<i>3<i>6]"
-                        + // 2
-                        "[(6-9)s:i|_2$<i>6<i>9]"
-                        + // 3
-                        "[(9-12)s:j|_3$<i>9<i>12]"
-                        + // 4
-                        "[(12-15)s:h|_4$<i>12<i>15]"
-                        + // 5
-                        "[(15-18)s:i|_5$<i>15<i>18]"
-                        + // 6
-                        "[(18-21)s:j|_6$<i>18<i>21]"
-                        + // 7
-                        "[(21-24)s:h|_7$<i>21<i>24]"
-                        + // 8
-                        "[(24-27)s:i|_8$<i>24<i>27]"
-                        + // 9
-                        "[(27-30)s:j|_9$<i>27<i>30]"
-                        + // 10
+                        + "<>:a$<b>64<i>0<i>27<i>8<b>0|_0$<i>0<i>3]" + // 1
+                        "[(3-6)s:h|_1$<i>3<i>6]" + // 2
+                        "[(6-9)s:i|_2$<i>6<i>9]" + // 3
+                        "[(9-12)s:j|_3$<i>9<i>12]" + // 4
+                        "[(12-15)s:h|_4$<i>12<i>15]" + // 5
+                        "[(15-18)s:i|_5$<i>15<i>18]" + // 6
+                        "[(18-21)s:j|_6$<i>18<i>21]" + // 7
+                        "[(21-24)s:h|_7$<i>21<i>24]" + // 8
+                        "[(24-27)s:i|_8$<i>24<i>27]" + // 9
+                        "[(27-30)s:j|_9$<i>27<i>30]" + // 10
                         "[(30-33)s:h|_10$<i>30<i>33|<>:a$<b>64<i>30<i>36<i>12<b>0]"
                         + // 11
                         "[(33-36)s:h|_11$<i>33<i>36|<>:a$<b>64<i>33<i>36<i>12<b>0]"); // 12
@@ -733,8 +724,8 @@
 
         // xyz
         fd = new FieldDocument();
-        fd.addTV("base", "x   y   z   ", "[(0-3)s:x]" + "[(3-6)s:y]"
-                + "[(6-9)s:z]");
+        fd.addTV("base", "x   y   z   ",
+                "[(0-3)s:x]" + "[(3-6)s:y]" + "[(6-9)s:z]");
         ki.addDoc(fd);
 
         // <a>x<a><b>y<a>zcde</a>cde</b></a>cde</a>
@@ -751,19 +742,19 @@
 
         // <a><a><a>h</a>hhij</a>hij</a>hij</a>
         fd = new FieldDocument();
-        fd.addTV("base", "h   i   j   h   i   j   h   i   j   ", "[(0-3)s:h|"
-                + "<>:a$<b>64<i>0<i>18<i>3<b>0|"
-                + "<>:a$<b>64<i>0<i>27<i>6<b>0|"
-                + "<>:a$<b>64<i>0<i>36<i>9<b>0]" + "[(3-6)s:h]"
-                + "[(12-15)s:i]" + "[(15-18)s:j]" + "[(18-21)s:h]"
-                + "[(21-24)s:i]" + "[(24-27)s:j]" + "[(27-30)s:h]"
-                + "[(30-33)s:i]" + "[(33-36)s:j]");
+        fd.addTV("base", "h   i   j   h   i   j   h   i   j   ",
+                "[(0-3)s:h|" + "<>:a$<b>64<i>0<i>18<i>3<b>0|"
+                        + "<>:a$<b>64<i>0<i>27<i>6<b>0|"
+                        + "<>:a$<b>64<i>0<i>36<i>9<b>0]" + "[(3-6)s:h]"
+                        + "[(12-15)s:i]" + "[(15-18)s:j]" + "[(18-21)s:h]"
+                        + "[(21-24)s:i]" + "[(24-27)s:j]" + "[(27-30)s:h]"
+                        + "[(30-33)s:i]" + "[(33-36)s:j]");
         ki.addDoc(fd);
 
         // xyz
         fd = new FieldDocument();
-        fd.addTV("base", "a  b  c  ", "[(0-3)s:a]" + "[(3-6)s:b]"
-                + "[(6-9)s:c]");
+        fd.addTV("base", "a  b  c  ",
+                "[(0-3)s:a]" + "[(3-6)s:b]" + "[(6-9)s:c]");
         ki.addDoc(fd);
 
         // Save documents
@@ -812,11 +803,8 @@
         // Er schrie: <s>"Das war ich!"</s>
         FieldDocument fd = new FieldDocument();
         fd = new FieldDocument();
-        fd.addTV(
-                "base",
-                "Er schrie: \"Das war ich!\" und ging.",
-                "[(0-2)s:Er|_0$<i>0<i>3]"
-                        + "[(3-9)s:schrie|_1$<i>3<i>9]"
+        fd.addTV("base", "Er schrie: \"Das war ich!\" und ging.",
+                "[(0-2)s:Er|_0$<i>0<i>3]" + "[(3-9)s:schrie|_1$<i>3<i>9]"
                         + "[(12-15)s:Das|_2$<i>12<i>15|<>:sentence$<b>64<i>11<i>25<i>5<b>0]"
                         + "[(16-19)s:war|_3$<i>16<i>19]"
                         + "[(20-23)s:ich|_4$<i>20<i>23]"
@@ -827,70 +815,85 @@
         // Save documents
         ki.commit();
 
-        SpanQuery sq = new SpanClassQuery(new SpanElementQuery("base",
-                "sentence"), (byte) 3);
+        SpanQuery sq = new SpanClassQuery(
+                new SpanElementQuery("base", "sentence"), (byte) 3);
         Result kr;
         kr = ki.search(sq, 0, (short) 15, true, (short) 1, true, (short) 1);
         assertEquals("totalResults", kr.getTotalResults(), 1);
 
-        assertEquals("... schrie: [[\"{3:Das war ich}!\"]] und ...", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("... schrie: [[\"{3:Das war ich}!\"]] und ...",
+                kr.getMatch(0).getSnippetBrackets());
         assertEquals(
                 "<span class=\"context-left\"><span class=\"more\"></span>schrie: </span><span class=\"match\"><mark>&quot;<mark class=\"class-3 level-0\">Das war ich</mark>!&quot;</mark></span><span class=\"context-right\"> und<span class=\"more\"></span></span>",
                 kr.getMatch(0).getSnippetHTML());
 
         kr = ki.search(sq, 0, (short) 15, true, (short) 0, true, (short) 0);
-        assertEquals("... [[\"{3:Das war ich}!\"]] ...", kr.getMatch(0)
-                .getSnippetBrackets());
+        assertEquals("... [[\"{3:Das war ich}!\"]] ...",
+                kr.getMatch(0).getSnippetBrackets());
         assertEquals("totalResults", kr.getTotalResults(), 1);
 
         kr = ki.search(sq, 0, (short) 15, true, (short) 6, true, (short) 6);
-        assertEquals("Er schrie: [[\"{3:Das war ich}!\"]] und ging.", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("Er schrie: [[\"{3:Das war ich}!\"]] und ging.",
+                kr.getMatch(0).getSnippetBrackets());
         assertEquals("totalResults", kr.getTotalResults(), 1);
 
         kr = ki.search(sq, 0, (short) 15, true, (short) 2, true, (short) 2);
-        assertEquals("Er schrie: [[\"{3:Das war ich}!\"]] und ging ...", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("Er schrie: [[\"{3:Das war ich}!\"]] und ging ...",
+                kr.getMatch(0).getSnippetBrackets());
         assertEquals("totalResults", kr.getTotalResults(), 1);
 
-        sq = new SpanClassQuery(new SpanWithinQuery(new SpanElementQuery(
-                "base", "sentence"), new SpanClassQuery(new SpanTermQuery(
-                new Term("base", "s:Das")), (byte) 2)), (byte) 1);
+        sq = new SpanClassQuery(
+                new SpanWithinQuery(new SpanElementQuery("base", "sentence"),
+                        new SpanClassQuery(
+                                new SpanTermQuery(new Term("base", "s:Das")),
+                                (byte) 2)),
+                (byte) 1);
 
         kr = ki.search(sq, (short) 15);
-        assertEquals("Er schrie: [[\"{1:{2:Das} war ich}!\"]] und ging.", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("Er schrie: [[\"{1:{2:Das} war ich}!\"]] und ging.",
+                kr.getMatch(0).getSnippetBrackets());
         assertEquals("totalResults", kr.getTotalResults(), 1);
 
-        sq = new SpanClassQuery(new SpanWithinQuery(new SpanElementQuery(
-                "base", "sentence"), new SpanClassQuery(new SpanTermQuery(
-                new Term("base", "s:war")), (byte) 2)), (byte) 1);
+        sq = new SpanClassQuery(
+                new SpanWithinQuery(new SpanElementQuery("base", "sentence"),
+                        new SpanClassQuery(
+                                new SpanTermQuery(new Term("base", "s:war")),
+                                (byte) 2)),
+                (byte) 1);
 
         kr = ki.search(sq, (short) 15);
-        assertEquals("Er schrie: [[\"{1:Das {2:war} ich}!\"]] und ging.", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("Er schrie: [[\"{1:Das {2:war} ich}!\"]] und ging.",
+                kr.getMatch(0).getSnippetBrackets());
         assertEquals("totalResults", kr.getTotalResults(), 1);
 
-        sq = new SpanClassQuery(new SpanWithinQuery(new SpanElementQuery(
-                "base", "sentence"), new SpanClassQuery(new SpanTermQuery(
-                new Term("base", "s:ich")), (byte) 2)), (byte) 1);
+        sq = new SpanClassQuery(
+                new SpanWithinQuery(new SpanElementQuery("base", "sentence"),
+                        new SpanClassQuery(
+                                new SpanTermQuery(new Term("base", "s:ich")),
+                                (byte) 2)),
+                (byte) 1);
 
         kr = ki.search(sq, (short) 15);
-        assertEquals("Er schrie: [[\"{1:Das war {2:ich}}!\"]] und ging.", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("Er schrie: [[\"{1:Das war {2:ich}}!\"]] und ging.",
+                kr.getMatch(0).getSnippetBrackets());
         assertEquals("totalResults", kr.getTotalResults(), 1);
 
-        sq = new SpanClassQuery(new SpanWithinQuery(new SpanElementQuery(
-                "base", "sentence"), new SpanClassQuery(new SpanTermQuery(
-                new Term("base", "s:und")), (byte) 2)), (byte) 1);
+        sq = new SpanClassQuery(
+                new SpanWithinQuery(new SpanElementQuery("base", "sentence"),
+                        new SpanClassQuery(
+                                new SpanTermQuery(new Term("base", "s:und")),
+                                (byte) 2)),
+                (byte) 1);
 
         kr = ki.search(sq, (short) 15);
         assertEquals("totalResults", kr.getTotalResults(), 0);
 
-        sq = new SpanClassQuery(new SpanWithinQuery(new SpanElementQuery(
-                "base", "sentence"), new SpanClassQuery(new SpanTermQuery(
-                new Term("base", "s:schrie")), (byte) 2)), (byte) 1);
+        sq = new SpanClassQuery(
+                new SpanWithinQuery(new SpanElementQuery("base", "sentence"),
+                        new SpanClassQuery(
+                                new SpanTermQuery(new Term("base", "s:schrie")),
+                                (byte) 2)),
+                (byte) 1);
 
         kr = ki.search(sq, (short) 15);
         assertEquals("totalResults", kr.getTotalResults(), 0);
@@ -904,12 +907,13 @@
         // Case 1, 6, 7, 13
         // xy<a><a>x</a>b<a>c</a></a>x
         FieldDocument fd = new FieldDocument();
-        fd.addTV("base", "x  y  x  b  c  x  ", "[(0-3)s:x|_0$<i>0<i>3]"
-                + "[(3-6)s:y|_1$<i>3<i>6]"
-                + "[(6-9)s:x|_2$<i>6<i>9|<>:a$<b>64<i>6<i>9<i>3<b>0|"
-                + "<>:a$<b>64<i>6<i>15<i>5<b>0]" + "[(9-12)s:b|_3$<i>9<i>12]"
-                + "[(12-15)s:c|_4$<i>12<i>15|<>:a$<b>64<i>12<i>15<i>5<b>0]"
-                + "[(15-18)s:x|_5$<i>15<i>18]");
+        fd.addTV("base", "x  y  x  b  c  x  ",
+                "[(0-3)s:x|_0$<i>0<i>3]" + "[(3-6)s:y|_1$<i>3<i>6]"
+                        + "[(6-9)s:x|_2$<i>6<i>9|<>:a$<b>64<i>6<i>9<i>3<b>0|"
+                        + "<>:a$<b>64<i>6<i>15<i>5<b>0]"
+                        + "[(9-12)s:b|_3$<i>9<i>12]"
+                        + "[(12-15)s:c|_4$<i>12<i>15|<>:a$<b>64<i>12<i>15<i>5<b>0]"
+                        + "[(15-18)s:x|_5$<i>15<i>18]");
         ki.addDoc(fd);
 
         // Save documents
@@ -925,10 +929,10 @@
 
         assertEquals("totalResults", kr.getTotalResults(), 2);
 
-        assertEquals("x  y  [[x  ]]b  c  x  ", kr.getMatch(0)
-                .getSnippetBrackets());
-        assertEquals("x  y  [[x  b  c  ]]x  ", kr.getMatch(1)
-                .getSnippetBrackets());
+        assertEquals("x  y  [[x  ]]b  c  x  ",
+                kr.getMatch(0).getSnippetBrackets());
+        assertEquals("x  y  [[x  b  c  ]]x  ",
+                kr.getMatch(1).getSnippetBrackets());
 
         assertEquals("StartPos (0)", 2, kr.getMatch(0).startPos);
         assertEquals("EndPos (0)", 3, kr.getMatch(0).endPos);
@@ -944,9 +948,7 @@
 
         // hij<a>hi<a>h<a>ij</a></a>hi</a>
         FieldDocument fd = new FieldDocument();
-        fd.addTV(
-                "base",
-                "hijhihijhi",
+        fd.addTV("base", "hijhihijhi",
                 "[(0-1)s:h|i:h|_0$<i>0<i>1|-:a$<i>3|-:t$<i>10]"
                         + "[(1-2)s:i|i:i|_1$<i>1<i>2]"
                         + "[(2-3)s:j|i:j|_2$<i>2<i>3]"
@@ -989,9 +991,7 @@
         // 2,5,8,12,13
         // h<a><a>i</a>j</a><a>h</a>i j<a>h i</a>j
         FieldDocument fd = new FieldDocument();
-        fd.addTV(
-                "base",
-                "hijhi jh ij",
+        fd.addTV("base", "hijhi jh ij",
                 "[(0-1)s:h|i:h|_0$<i>0<i>1|-:a$<i>4|-:t$<i>9]"
                         + "[(1-2)s:i|i:i|_1$<i>1<i>2|<>:a$<b>64<i>1<i>2<i>2<b>0|"
                         + "<>:a$<b>64<i>1<i>3<i>3<b>0]"
@@ -1011,9 +1011,9 @@
 
         SpanQuery sq = new SpanWithinQuery(new SpanElementQuery("base", "a"),
                 new SpanNextQuery(new SpanTermQuery(new Term("base", "s:h")),
-                        new SpanNextQuery(new SpanTermQuery(new Term("base",
-                                "s:i")), new SpanTermQuery(new Term("base",
-                                "s:j")))));
+                        new SpanNextQuery(
+                                new SpanTermQuery(new Term("base", "s:i")),
+                                new SpanTermQuery(new Term("base", "s:j")))));
 
         Result kr = ki.search(sq, (short) 10);
         assertEquals("totalResults", kr.getTotalResults(), 0);
@@ -1026,9 +1026,7 @@
         // 4,5,11,13
         // x<a>x h</a>i j h<a>i j</a>
         FieldDocument fd = new FieldDocument();
-        fd.addTV(
-                "base",
-                "xx hi j hi j",
+        fd.addTV("base", "xx hi j hi j",
                 "[(0-1)s:x|i:x|_0$<i>0<i>1|-:a$<i>2|-:t$<i>8]"
                         + "[(1-2)s:x|i:x|_1$<i>1<i>2|<>:a$<b>64<i>1<i>4<i>3<b>0]"
                         + "[(3-4)s:h|i:h|_2$<i>3<i>4]"
@@ -1046,9 +1044,9 @@
 
         SpanQuery sq = new SpanWithinQuery(new SpanElementQuery("base", "a"),
                 new SpanNextQuery(new SpanTermQuery(new Term("base", "s:h")),
-                        new SpanNextQuery(new SpanTermQuery(new Term("base",
-                                "s:i")), new SpanTermQuery(new Term("base",
-                                "s:j")))));
+                        new SpanNextQuery(
+                                new SpanTermQuery(new Term("base", "s:i")),
+                                new SpanTermQuery(new Term("base", "s:j")))));
 
         Result kr = ki.search(sq, (short) 10);
 
@@ -1062,9 +1060,7 @@
         KrillIndex ki = new KrillIndex();
         FieldDocument fd = new FieldDocument();
         // <a>xx <e>hi j <e>hi j</e></e></a>
-        fd.addTV(
-                "base",
-                "xx hi j hi j",
+        fd.addTV("base", "xx hi j hi j",
                 "[(0-1)s:x|i:x|_0$<i>0<i>1|<>:a$<b>64<i>0<i>12<i>8<b>0]"
                         + "[(1-2)s:x|i:x|_1$<i>1<i>2]"
                         + "[(3-4)s:h|i:h|_2$<i>3<i>4|<>:e$<b>64<i>3<i>12<i>8<b>0]"
@@ -1086,11 +1082,11 @@
         sqw = qb.seg("i:x");
         kr = ki.search(sqw.toQuery(), (short) 10);
         assertEquals(2, kr.getTotalResults());
-
+        
         sqw = qb.tag("a");
         kr = ki.search(sqw.toQuery(), (short) 10);
         assertEquals(1, kr.getTotalResults());
-
+        
         sqw = qb.startswith(qb.tag("a"), qb.seg("i:x"));
         assertEquals("spanStartsWith(<base:a />, base:i:x)",
                      sqw.toQuery().toString());
@@ -1098,8 +1094,8 @@
         assertEquals(1, kr.getTotalResults());
         */
         sqw = qb.startswith(qb.tag("e"), qb.seg("i:h"));
-        assertEquals("spanStartsWith(<base:e />, base:i:h)", sqw.toQuery()
-                .toString());
+        assertEquals("spanStartsWith(<base:e />, base:i:h)",
+                sqw.toQuery().toString());
         kr = ki.search(sqw.toQuery(), (short) 10);
         assertEquals(2, kr.getTotalResults());
     };
@@ -1108,8 +1104,9 @@
     // contains(<s>, (es wird | wird es))
     @Test
     public void queryJSONpoly2 () throws QueryException, IOException {
-        String jsonPath = URLDecoder.decode(getClass().getResource("/queries/poly2.json")
-                .getFile(),"UTF-8");
+        String jsonPath = URLDecoder.decode(
+                getClass().getResource("/queries/poly2.json").getFile(),
+                "UTF-8");
         String jsonPQuery = readFile(jsonPath);
         SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonPQuery);
 
@@ -1135,8 +1132,8 @@
 
 
     @Test
-    public void queryJSONcomplexSpanOrTerm () throws QueryException,
-            IOException {
+    public void queryJSONcomplexSpanOrTerm ()
+            throws QueryException, IOException {
         /*
           at org.apache.lucene.search.spans.SpanOrQuery$1.doc(SpanOrQuery.java:234)
           at de.ids_mannheim.korap.query.spans.WithinSpans.toSameDoc(WithinSpans.java:423)
@@ -1145,15 +1142,18 @@
           at de.ids_mannheim.korap.Krill.apply(Krill.java:304)
         */
 
-        String jsonPath = URLDecoder.decode(getClass().getResource(
-                "/queries/bugs/span_or_bug.jsonld").getFile(),"UTF-8");
+        String jsonPath = URLDecoder.decode(getClass()
+                .getResource("/queries/bugs/span_or_bug.jsonld").getFile(),
+                "UTF-8");
         String jsonPQuery = readFile(jsonPath);
         SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonPQuery);
 
         SpanWithinQuery sq = (SpanWithinQuery) sqwi.toQuery();
 
-        assertEquals("spanStartsWith(<tokens:base/s:s />, "
-                + "spanOr([tokens:s:Er, tokens:s:Sie]))", sq.toString());
+        assertEquals(
+                "spanStartsWith(<tokens:base/s:s />, "
+                        + "spanOr([tokens:s:Er, tokens:s:Sie]))",
+                sq.toString());
 
         KrillIndex ki = new KrillIndex();
 
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestKrillQuery.java b/src/test/java/de/ids_mannheim/korap/query/TestKrillQuery.java
index 7111b38..101290d 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestKrillQuery.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestKrillQuery.java
@@ -139,10 +139,9 @@
     @Test
     public void KorapClassQuery () throws QueryException {
         QueryBuilder kq = new QueryBuilder("field");
-        SpanQuery sq = kq
-                .seq(kq.seg("tree"),
-                        kq._(1, kq.contains(kq.tag("s"), kq.tag("np"))),
-                        kq.re("hey.*")).toQuery();
+        SpanQuery sq = kq.seq(kq.seg("tree"),
+                kq._(1, kq.contains(kq.tag("s"), kq.tag("np"))), kq.re("hey.*"))
+                .toQuery();
         assertEquals(
                 "spanNext(spanNext(field:tree, {1: spanContain(<field:s />, <field:np />)}), SpanMultiTermQueryWrapper(field:/hey.*/))",
                 sq.toString());
@@ -196,11 +195,8 @@
     @Test
     public void KorapShrinkQuery3 () throws QueryException {
         QueryBuilder kq = new QueryBuilder("field");
-        SpanQuery sq = kq
-                .focus(1,
-                        kq._(1,
-                                kq.seq(kq.tag("np"),
-                                        kq._(kq.seg("test").without("no")))))
+        SpanQuery sq = kq.focus(1, kq._(1,
+                kq.seq(kq.tag("np"), kq._(kq.seg("test").without("no")))))
                 .toQuery();
         assertEquals(
                 "focus(1: {1: spanNext(<field:np />, {1: spanNot(field:test, field:no, 0, 0)})})",
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java b/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java
index d66be4f..af53472 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestKrillQueryJSON.java
@@ -22,13 +22,12 @@
 
     @Test
     public void queryJSONBsp1 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp1.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp1.jsonld").getFile());
 
         // There is a repetition in here
         // ([base=foo]|[base=bar])[base=foobar]
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "spanOr([tokens:base:foo, spanRepetition(spanNext(tokens:base:foo, tokens:base:bar){1,100})])");
         assertTrue(sqwi.isOptional());
     };
@@ -36,13 +35,12 @@
 
     @Test
     public void queryJSONBsp1Disjunction () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp1c.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp1c.jsonld").getFile());
 
         // There is a repetition in here
         // ([base=foo]|[base=bar])[base=foobar]
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "spanOr([tokens:base:foo, spanRepetition(spanNext(tokens:base:foo, tokens:base:bar){1,100})])");
         assertTrue(sqwi.isOptional());
     };
@@ -51,8 +49,8 @@
     @Test
     public void queryJSONBsp1b () throws QueryException {
 
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp1b.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp1b.jsonld").getFile());
 
         // [base=foo]|([base=foo][base=bar]) meta author=Goethe&year=1815
         assertEquals(sqwi.toQuery().toString(),
@@ -62,20 +60,19 @@
 
     @Test
     public void queryJSONBsp2 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp2.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp2.jsonld").getFile());
 
         // ([base=foo]|[base=bar])[base=foobar]
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "spanNext(spanOr([tokens:mate/l:foo, tokens:mate/l:bar]), tokens:mate/l:foobar)");
     };
 
 
     @Test
     public void queryJSONBsp3 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp3.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp3.jsonld").getFile());
 
         // focus({[base=Mann]})
         assertEquals(sqwi.toQuery().toString(),
@@ -85,8 +82,8 @@
 
     @Test
     public void queryJSONBsp4 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp4.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp4.jsonld").getFile());
 
         // focus({[base=foo]}[orth=bar])
         assertEquals(sqwi.toQuery().toString(),
@@ -96,8 +93,8 @@
 
     @Test
     public void queryJSONBsp5 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp5.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp5.jsonld").getFile());
 
         // focus(1:[base=Der]{1:[base=Mann]}) 
         assertEquals(sqwi.toQuery().toString(),
@@ -107,8 +104,8 @@
 
     @Test
     public void queryJSONBsp6 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp6.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp6.jsonld").getFile());
 
         // [base=katze]
         assertEquals(sqwi.toQuery().toString(), "tokens:mate/l:Katze");
@@ -117,8 +114,8 @@
 
     @Test
     public void queryJSONBsp7 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp7.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp7.jsonld").getFile());
 
         // [!base=Katze]
         assertEquals("tokens:mate/l:Katze", sqwi.toQuery().toString());
@@ -128,8 +125,8 @@
 
     @Test
     public void queryJSONBsp9 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp9.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp9.jsonld").getFile());
 
         // [base=Katze&orth=Katzen]
         assertEquals(sqwi.toQuery().toString(),
@@ -139,8 +136,8 @@
 
     @Test
     public void queryJSONBsp9b () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp9b.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp9b.jsonld").getFile());
 
         // [base=Katze&orth=Katzen]
         assertEquals(sqwi.toQuery().toString(),
@@ -150,8 +147,8 @@
 
     @Test
     public void queryJSONBsp10 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp10.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp10.jsonld").getFile());
 
         // [base=Katze][orth=und][orth=Hunde]
         assertEquals(sqwi.toQuery().toString(),
@@ -161,8 +158,8 @@
 
     @Test
     public void queryJSONBsp11 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp11.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp11.jsonld").getFile());
 
         // [base!=Katze | orth!=Katzen]
         /*
@@ -178,8 +175,8 @@
 
     @Test
     public void queryJSONBsp12 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp12.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp12.jsonld").getFile());
 
         // contains(<np>,[base=Mann])
         assertEquals(sqwi.toQuery().toString(),
@@ -189,8 +186,8 @@
 
     @Test
     public void queryJSONBsp13 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp13.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp13.jsonld").getFile());
 
         assertEquals(sqwi.toQuery().toString(),
                 "spanStartsWith(<tokens:np />, tokens:p:Det)");
@@ -199,8 +196,8 @@
 
     @Test
     public void queryJSONBsp13b () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp13b.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp13b.jsonld").getFile());
 
         // startswith(<np>,[pos=Det])
         assertEquals(sqwi.toQuery().toString(),
@@ -210,8 +207,8 @@
 
     @Test
     public void queryJSONBsp14 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp14.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp14.jsonld").getFile());
 
         // 'vers{2,3}uch'
         assertEquals(sqwi.toQuery().toString(),
@@ -221,8 +218,8 @@
 
     @Test
     public void queryJSONBsp15 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp15.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp15.jsonld").getFile());
 
         // [orth='vers.*ch']
         assertEquals(sqwi.toQuery().toString(),
@@ -232,8 +229,8 @@
 
     @Test
     public void queryJSONBsp16 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp16.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp16.jsonld").getFile());
 
         // [(base=bar|base=foo)&orth=foobar]
         assertEquals(sqwi.toQuery().toString(),
@@ -243,8 +240,8 @@
 
     @Test
     public void queryJSONBsp17 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp17.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp17.jsonld").getFile());
 
         // within(<np>,[base=Mann])
         assertEquals(sqwi.toQuery().toString(),
@@ -254,8 +251,8 @@
 
     @Test
     public void queryJSONDemo () throws QueryException {
-        SpanQueryWrapper sqwi = new KrillQuery("tokens")
-                .fromKoral("{ \"query\" : { \"@type\" : \"koral:token\", \"wrap\" : { \"@type\" : \"koral:term\", \"foundry\" : \"base\", \"layer\" : \"p\", \"key\" : \"foo\", \"match\" : \"match:eq\" }}}");
+        SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(
+                "{ \"query\" : { \"@type\" : \"koral:token\", \"wrap\" : { \"@type\" : \"koral:term\", \"foundry\" : \"base\", \"layer\" : \"p\", \"key\" : \"foo\", \"match\" : \"match:eq\" }}}");
 
         assertEquals(sqwi.toQuery().toString(), "tokens:base/p:foo");
     };
@@ -263,8 +260,8 @@
 
     @Test
     public void queryJSONBspClass () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp-class.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bsp-class.jsonld").getFile());
 
         // within(<np>,[base=Mann])
         assertEquals(sqwi.toQuery().toString(),
@@ -274,8 +271,8 @@
 
     @Test
     public void queryJSONcosmas3 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/cosmas3.json").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/cosmas3.json").getFile());
 
         // "das /+w1:3 Buch"
         assertEquals(sqwi.toQuery().toString(),
@@ -285,56 +282,52 @@
 
     @Test
     public void queryJSONcosmas4 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/cosmas4.json").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/cosmas4.json").getFile());
 
         // "das /+w1:3,s1:1 Buch"
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "spanMultipleDistance(tokens:s:das, tokens:s:Buch, [(w[1:3], ordered, notExcluded), (base/s:s[1:1], ordered, notExcluded)])");
     };
 
 
     @Test
     public void queryJSONcosmas4b () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/cosmas4b.json").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/cosmas4b.json").getFile());
 
         // "das /+w1:3,s1 Buch"
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "spanMultipleDistance(tokens:s:das, tokens:s:Buch, [(w[1:3], ordered, notExcluded), (base/s:s[0:1], ordered, notExcluded)])");
     };
 
 
     @Test
     public void queryJSONcosmas10 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/cosmas10.json").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/cosmas10.json").getFile());
 
         // "Institut für $deutsche Sprache"
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "spanNext(spanNext(spanNext(tokens:s:Institut, tokens:s:für), tokens:i:deutsche), tokens:s:Sprache)");
     };
 
 
     @Test
     public void queryJSONcosmas10b () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/cosmas10b.json").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/cosmas10b.json").getFile());
 
         // "Institut $FÜR $deutsche Sprache"
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "spanNext(spanNext(spanNext(tokens:s:Institut, tokens:i:für), tokens:i:deutsche), tokens:s:Sprache)");
     };
 
 
     @Test
     public void queryJSONcosmas16 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/cosmas16.json").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/cosmas16.json").getFile());
 
         // "$wegen #IN(L) <s>"
         assertEquals(sqwi.toQuery().toString(),
@@ -344,8 +337,8 @@
 
     @Test
     public void queryJSONcosmas17 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/cosmas17.json").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/cosmas17.json").getFile());
 
         // "#BED($wegen , +sa)"
         assertEquals(sqwi.toQuery().toString(),
@@ -355,8 +348,8 @@
 
     @Test
     public void queryJSONcosmas20 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/cosmas20.json").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/cosmas20.json").getFile());
 
         //     "MORPH(V) #IN(R) #ELEM(S)"
         assertEquals(sqwi.toQuery().toString(),
@@ -366,20 +359,19 @@
 
     @Test
     public void queryJSONrepetition () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp-repetition.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(getClass()
+                .getResource("/queries/bsp-repetition.jsonld").getFile());
 
         // der[cnx/p=A]{0,2}[tt/p=NN]
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "spanNext(tokens:s:der, spanOr([tokens:tt/p:NN, spanNext(spanRepetition(tokens:cnx/p:A{1,2}), tokens:tt/p:NN)]))");
     };
 
 
     @Test
     public void queryJSONboundaryBug () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bsp-boundary.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(getClass()
+                .getResource("/queries/bsp-boundary.jsonld").getFile());
 
         // Tal []{1,} Wald
         assertEquals(sqwi.toQuery().toString(),
@@ -389,20 +381,20 @@
 
     @Test
     public void queryJSONcosmasBoundaryBug () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bugs/cosmas_boundary.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(getClass()
+                .getResource("/queries/bugs/cosmas_boundary.jsonld").getFile());
 
         // Namen /s1 Leben
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "focus(129: spanElementDistance({129: tokens:s:Namen}, {129: tokens:s:Leben}, [(base/s:s[0:1], notOrdered, notExcluded)]))");
     };
 
 
     @Test
     public void queryJSONfoundryForOrthBug () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bugs/foundry_for_orth.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/bugs/foundry_for_orth.jsonld")
+                        .getFile());
 
         // opennlp/orth:Baum
         assertEquals(sqwi.toQuery().toString(), "tokens:s:Baum");
@@ -411,8 +403,9 @@
 
     @Test
     public void queryJSONfoundryForOrthBug2 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bugs/foundry_for_orth_2.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(getClass()
+                .getResource("/queries/bugs/foundry_for_orth_2.jsonld")
+                .getFile());
 
         // baum/i
         assertEquals(sqwi.toQuery().toString(), "tokens:i:baum");
@@ -423,8 +416,9 @@
     public void queryJSONunderspecifiedTokenBug () {
         // ((MORPH(APPR) ODER MORPH(APPRART)) /+w1 Urlaub
         try {
-            String json = getString(getClass().getResource(
-                    "/queries/bugs/underspecified_token.jsonld").getFile());
+            String json = getString(getClass()
+                    .getResource("/queries/bugs/underspecified_token.jsonld")
+                    .getFile());
             new KrillQuery("tokens").fromKoral(json);
         }
         catch (QueryException e) {
@@ -435,10 +429,9 @@
 
     @Test
     public void queryJSONspecialLayerBug () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bugs/special_layer.jsonld").getFile());
-        assertEquals(
-                sqwi.toQuery().toString(),
+        SpanQueryWrapper sqwi = jsonQuery(getClass()
+                .getResource("/queries/bugs/special_layer.jsonld").getFile());
+        assertEquals(sqwi.toQuery().toString(),
                 "spanNext(spanNext(spanNext(tokens:s:Baum, tokens:cnx/p:CC), tokens:tt/l:Baum), <tokens:xip/c:MC />)");
     };
 
@@ -446,11 +439,11 @@
     @Test
     public void queryJSONrepetitionGroupRewriteBug () throws QueryException {
         // ([cnx/p="A"][]){2}
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bugs/repetition_group_rewrite.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(getClass()
+                .getResource("/queries/bugs/repetition_group_rewrite.jsonld")
+                .getFile());
 
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "spanRepetition(spanExpansion(SpanMultiTermQueryWrapper(tokens:/cnx/p:A/), []{1, 1}, right){2,2})");
     };
 
@@ -458,11 +451,11 @@
     @Test
     public void queryJSONoverlapsFrameWorkaround () throws QueryException {
         // overlaps(<s>,[tt/p=CARD][tt/p="N.*"])
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bugs/overlaps_frame_workaround.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(getClass()
+                .getResource("/queries/bugs/overlaps_frame_workaround.jsonld")
+                .getFile());
 
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "spanOverlap(<tokens:s />, spanNext(tokens:tt/p:CARD, SpanMultiTermQueryWrapper(tokens:/tt/p:N.*/)))");
     };
 
@@ -470,8 +463,9 @@
     @Test
     public void queryJSONflags1 () throws QueryException {
         // buchstabe/i
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/flags/caseInsensitive.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(
+                getClass().getResource("/queries/flags/caseInsensitive.jsonld")
+                        .getFile());
 
         assertEquals(sqwi.toQuery().toString(), "tokens:i:buchstabe");
     };
@@ -480,11 +474,11 @@
     @Test
     public void queryJSONspanWrapDeserializationBug () throws QueryException {
         // contains(<s>, Erde  []* Sonne)
-        SpanQueryWrapper sqwi = jsonQuery(getClass().getResource(
-                "/queries/bugs/unspecified_key_bug.jsonld").getFile());
+        SpanQueryWrapper sqwi = jsonQuery(getClass()
+                .getResource("/queries/bugs/unspecified_key_bug.jsonld")
+                .getFile());
 
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "spanContain(<tokens:s />, spanDistance(tokens:s:Erde, tokens:s:Sonne, [(w[1:101], ordered, notExcluded)]))");
     };
 
@@ -493,22 +487,22 @@
     public void queryJSONflags2 () throws QueryException {
         // buchstabe/i
         try {
-            String json = getString(getClass().getResource(
-                    "/queries/flags/unknown1.jsonld").getFile());
+            String json = getString(getClass()
+                    .getResource("/queries/flags/unknown1.jsonld").getFile());
             KrillQuery kq = new KrillQuery("tokens");
             assertEquals(kq.fromKoral(json).toQuery().toString(),
                     "tokens:s:buchstabe");
             assertEquals(kq.getWarning(0).getCode(), 748);
 
-            json = getString(getClass().getResource(
-                    "/queries/flags/unknown2.jsonld").getFile());
+            json = getString(getClass()
+                    .getResource("/queries/flags/unknown2.jsonld").getFile());
             kq = new KrillQuery("tokens");
             assertEquals(kq.fromKoral(json).toQuery().toString(),
                     "tokens:i:buchstabe");
             assertEquals(kq.getWarning(0).getCode(), 748);
 
-            json = getString(getClass().getResource(
-                    "/queries/flags/unknown3.jsonld").getFile());
+            json = getString(getClass()
+                    .getResource("/queries/flags/unknown3.jsonld").getFile());
             kq = new KrillQuery("tokens");
             assertEquals(kq.fromKoral(json).toQuery().toString(),
                     "tokens:i:buchstabe");
@@ -525,8 +519,9 @@
     public void queryJSONelement () throws QueryException {
         // <base/s=s>
         try {
-            String json = getString(getClass().getResource(
-                    "/queries/element/simple-element.jsonld").getFile());
+            String json = getString(getClass()
+                    .getResource("/queries/element/simple-element.jsonld")
+                    .getFile());
             KrillQuery kq = new KrillQuery("tokens");
 
             assertEquals(kq.fromKoral(json).toQuery().toString(),
@@ -542,12 +537,12 @@
     public void queryJSONinfiniteExpansion () throws QueryException {
         // der []*
         try {
-            String json = getString(getClass().getResource(
-                    "/queries/bugs/expansion_bug_3.jsonld").getFile());
+            String json = getString(getClass()
+                    .getResource("/queries/bugs/expansion_bug_3.jsonld")
+                    .getFile());
             KrillQuery kq = new KrillQuery("tokens");
 
-            assertEquals(
-                    kq.fromKoral(json).toQuery().toString(),
+            assertEquals(kq.fromKoral(json).toQuery().toString(),
                     "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:s:c, []{0, 4}, right)}))");
         }
         catch (QueryException e) {
@@ -560,8 +555,8 @@
     public void queryJSONcomplexSpanOrTerm () throws QueryException {
         // startsWith(<base/s=s>, { lassen | laufen })
         try {
-            String json = getString(getClass().getResource(
-                    "/queries/bugs/span_or_bug.jsonld").getFile());
+            String json = getString(getClass()
+                    .getResource("/queries/bugs/span_or_bug.jsonld").getFile());
             KrillQuery kq = new KrillQuery("tokens");
 
             assertEquals(kq.fromKoral(json).toQuery().toString(),
@@ -577,12 +572,13 @@
     public void queryJSONdistancesWithRegexes () throws QueryException {
         // "der" []{2,3} [opennlp/p="NN"]
         try {
-            String json = getString(getClass().getResource(
-                    "/queries/bugs/distances_with_regex_bug.jsonld").getFile());
+            String json = getString(getClass()
+                    .getResource(
+                            "/queries/bugs/distances_with_regex_bug.jsonld")
+                    .getFile());
             KrillQuery kq = new KrillQuery("tokens");
 
-            assertEquals(
-                    kq.fromKoral(json).toQuery().toString(),
+            assertEquals(kq.fromKoral(json).toQuery().toString(),
                     "spanDistance(SpanMultiTermQueryWrapper(tokens:/s:der/), SpanMultiTermQueryWrapper(tokens:/opennlp/p:NN/), [(w[3:4], ordered, notExcluded)])");
         }
         catch (QueryException e) {
@@ -590,35 +586,38 @@
         };
     };
 
-	@Test
+
+    @Test
     public void queryJSONregexRewrite1 () throws QueryException {
         // "der" [.+?]
-		String json = getString(getClass().getResource(
-									"/queries/sequence/regex-rewrite-1.jsonld").getFile());
-		KrillQuery kq = new KrillQuery("tokens");
+        String json = getString(getClass()
+                .getResource("/queries/sequence/regex-rewrite-1.jsonld")
+                .getFile());
+        KrillQuery kq = new KrillQuery("tokens");
 
-		assertEquals(
-			kq.fromKoral(json).toQuery().toString(),
-			"focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:s:der, []{1, 1}, right)}))");
+        assertEquals(kq.fromKoral(json).toQuery().toString(),
+                "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:s:der, []{1, 1}, right)}))");
     };
 
-	@Test
+
+    @Test
     public void queryJSONregexRewrite2 () throws QueryException {
         // "der" [.*] [.*?] [.+] [.+?]
-		String json = getString(getClass().getResource(
-									"/queries/sequence/regex-rewrite-2.jsonld").getFile());
-		KrillQuery kq = new KrillQuery("tokens");
+        String json = getString(getClass()
+                .getResource("/queries/sequence/regex-rewrite-2.jsonld")
+                .getFile());
+        KrillQuery kq = new KrillQuery("tokens");
 
-		assertEquals(
-			kq.fromKoral(json).toQuery().toString(),
-			"focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:s:der, []{4, 4}, right)}))");
+        assertEquals(kq.fromKoral(json).toQuery().toString(),
+                "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:s:der, []{4, 4}, right)}))");
     };
 
 
     public static String getString (String path) {
         StringBuilder contentBuilder = new StringBuilder();
         try {
-            BufferedReader in = new BufferedReader(new FileReader(URLDecoder.decode(path,"UTF-8")));
+            BufferedReader in = new BufferedReader(
+                    new FileReader(URLDecoder.decode(path, "UTF-8")));
             String str;
             while ((str = in.readLine()) != null) {
                 contentBuilder.append(str);
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestSpanAlterQuery.java b/src/test/java/de/ids_mannheim/korap/query/TestSpanAlterQuery.java
index 70b559e..b259fb8 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestSpanAlterQuery.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestSpanAlterQuery.java
@@ -29,8 +29,8 @@
 
         SpanAlterQueryWrapper ssaquery = new SpanAlterQueryWrapper("field");
         ssaquery.or("b").or("c");
-        assertEquals("spanOr([field:b, field:c])", ssaquery.toQuery()
-                .toString());
+        assertEquals("spanOr([field:b, field:c])",
+                ssaquery.toQuery().toString());
     };
 
 
@@ -38,8 +38,8 @@
     public void spanAlterQuery3 () throws QueryException {
         SpanAlterQueryWrapper ssaquery = new SpanAlterQueryWrapper("field");
         ssaquery.or("b").or("c").or("d");
-        assertEquals("spanOr([field:b, field:c, field:d])", ssaquery.toQuery()
-                .toString());
+        assertEquals("spanOr([field:b, field:c, field:d])",
+                ssaquery.toQuery().toString());
     };
 
 
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestSpanReferenceQueryJSON.java b/src/test/java/de/ids_mannheim/korap/query/TestSpanReferenceQueryJSON.java
index b9ef7c4..844b8ec 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestSpanReferenceQueryJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestSpanReferenceQueryJSON.java
@@ -16,8 +16,10 @@
     @Test
     public void testFirstOperandRef () throws IOException, QueryException {
 
-        String filepath = getClass().getResource(
-                "/queries/reference/first-operand-reference.jsonld").getFile();
+        String filepath = getClass()
+                .getResource(
+                        "/queries/reference/first-operand-reference.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
 
@@ -36,8 +38,10 @@
     @Test
     public void testSecondOperandRef () throws QueryException {
 
-        String filepath = getClass().getResource(
-                "/queries/reference/second-operand-reference.jsonld").getFile();
+        String filepath = getClass()
+                .getResource(
+                        "/queries/reference/second-operand-reference.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
 
@@ -47,14 +51,16 @@
                 "spanReference(spanNext(focus(2: focus(#[1,2]spanSegment({3: tokens:p:P}, "
                         + "focus(#2: spanSegment(spanRelation(tokens:>:mate/d:HEAD), "
                         + "focus(1: spanNext({2: tokens:p:V}, {1: <tokens:c:NP />}))))))), "
-                        + "{3: tokens:p:P}), 3)", sq.toString());
+                        + "{3: tokens:p:P}), 3)",
+                sq.toString());
     }
 
 
     @Test
     public void testMultipleReferences () throws QueryException {
-        String filepath = getClass().getResource(
-                "/queries/reference/multiple-references.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/reference/multiple-references.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
 
@@ -74,8 +80,9 @@
 
         // ND: I don't understand what this query should be about ...
         // EM: There was just a bug with multiple distance
-        String filepath = getClass().getResource(
-                "/queries/reference/bug-multiple-distance-simple.jsonld")
+        String filepath = getClass()
+                .getResource(
+                        "/queries/reference/bug-multiple-distance-simple.jsonld")
                 .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
@@ -85,8 +92,9 @@
                 sq.toString());
 
         // "/queries/reference/distance-reference.jsonld").getFile();
-        filepath = getClass().getResource(
-                "/queries/reference/bug-multiple-distance.jsonld").getFile();
+        filepath = getClass()
+                .getResource("/queries/reference/bug-multiple-distance.jsonld")
+                .getFile();
         sqwi = getJSONQuery(filepath);
         sq = sqwi.toQuery();
 
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestSpanRelationQueryJSON.java b/src/test/java/de/ids_mannheim/korap/query/TestSpanRelationQueryJSON.java
index caaef7b..8be9a79 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestSpanRelationQueryJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestSpanRelationQueryJSON.java
@@ -14,8 +14,9 @@
     @Test
     public void testMatchAnyRelationSourceWithAttribute ()
             throws QueryException {
-        String filepath = getClass().getResource(
-                "/queries/relation/any-source-with-attribute.json").getFile();
+        String filepath = getClass()
+                .getResource("/queries/relation/any-source-with-attribute.json")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
 
@@ -30,18 +31,20 @@
     @Test
     public void testMatchAnyRelationTargetWithAttribute ()
             throws QueryException {
-        String filepath = getClass().getResource(
-                "/queries/relation/any-target-with-attribute.json").getFile();
+        String filepath = getClass()
+                .getResource("/queries/relation/any-target-with-attribute.json")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
-        // "focus(#[1,2]spanSegment(focus(#2: spanSegment(spanRelation(tokens:>:mate/d:HEAD), "
-        // +
-        // "<tokens:c:vp />)), spanWithAttribute(spanAttribute(tokens:type:case:accusative))))",
-        //
+                // "focus(#[1,2]spanSegment(focus(#2: spanSegment(spanRelation(tokens:>:mate/d:HEAD), "
+                // +
+                // "<tokens:c:vp />)), spanWithAttribute(spanAttribute(tokens:type:case:accusative))))",
+                //
                 "focus(#[1,2]spanSegment(spanWithAttribute(spanAttribute(tokens:type:case:accusative)), "
                         + "focus(#2: spanSegment(spanRelation(tokens:>:mate/d:HEAD), "
-                        + "<tokens:c:vp />))))", sq.toString());
+                        + "<tokens:c:vp />))))",
+                sq.toString());
 
         // System.out.println(sq.toString());
     }
@@ -50,24 +53,28 @@
     @Test
     public void testMatchSpecificRelationSourceWithAttribute ()
             throws QueryException {
-        String filepath = getClass().getResource(
-                "/queries/relation/specific-source-with-attribute.json")
+        String filepath = getClass()
+                .getResource(
+                        "/queries/relation/specific-source-with-attribute.json")
                 .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
 
-        assertEquals("focus(#[1,2]spanSegment(<tokens:c:vp />, "
-                + "focus(#2: spanSegment(spanRelation(tokens:>:mate/d:HEAD), "
-                + "spanElementWithAttribute(<tokens:c:np />, "
-                + "spanAttribute(tokens:type:case:accusative))))))",
+        assertEquals(
+                "focus(#[1,2]spanSegment(<tokens:c:vp />, "
+                        + "focus(#2: spanSegment(spanRelation(tokens:>:mate/d:HEAD), "
+                        + "spanElementWithAttribute(<tokens:c:np />, "
+                        + "spanAttribute(tokens:type:case:accusative))))))",
                 sq.toString());
     }
 
 
     @Test
-    public void testMatchBothRelationNodeWithAttribute () throws QueryException {
-        String filepath = getClass().getResource(
-                "/queries/relation/both-operands-with-attribute.json")
+    public void testMatchBothRelationNodeWithAttribute ()
+            throws QueryException {
+        String filepath = getClass()
+                .getResource(
+                        "/queries/relation/both-operands-with-attribute.json")
                 .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
@@ -84,8 +91,8 @@
     @Test
     public void testMatchRelationSource () throws QueryException {
         //
-        String filepath = getClass().getResource(
-                "/queries/relation/match-source.json").getFile();
+        String filepath = getClass()
+                .getResource("/queries/relation/match-source.json").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -97,8 +104,8 @@
     @Test
     public void testMatchRelationTarget () throws QueryException {
         //
-        String filepath = getClass().getResource(
-                "/queries/relation/match-target.json").getFile();
+        String filepath = getClass()
+                .getResource("/queries/relation/match-target.json").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -110,8 +117,9 @@
     @Test
     public void testMatchRelationSourceAndTarget () throws QueryException {
         //
-        String filepath = getClass().getResource(
-                "/queries/relation/match-source-and-target.json").getFile();
+        String filepath = getClass()
+                .getResource("/queries/relation/match-source-and-target.json")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -124,8 +132,9 @@
     @Test
     public void testMatchOperandWithProperty () throws QueryException {
         //
-        String filepath = getClass().getResource(
-                "/queries/relation/operand-with-property.json").getFile();
+        String filepath = getClass()
+                .getResource("/queries/relation/operand-with-property.json")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -138,8 +147,9 @@
     @Test
     public void testMatchOperandWithAttribute () throws QueryException {
         //
-        String filepath = getClass().getResource(
-                "/queries/relation/operand-with-attribute.json").getFile();
+        String filepath = getClass()
+                .getResource("/queries/relation/operand-with-attribute.json")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -152,8 +162,8 @@
     @Test
     public void testMatchRelationOnly () throws QueryException {
         //
-        String filepath = getClass().getResource(
-                "/queries/relation/relation-only.json").getFile();
+        String filepath = getClass()
+                .getResource("/queries/relation/relation-only.json").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals("focus(#[1,2]spanRelation(tokens:>:mate/d:HEAD))",
@@ -164,8 +174,8 @@
     @Test
     public void testFocusSource () throws QueryException {
         //
-        String filepath = getClass().getResource(
-                "/queries/relation/focus-source.json").getFile();
+        String filepath = getClass()
+                .getResource("/queries/relation/focus-source.json").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -176,8 +186,8 @@
 
     @Test
     public void testFocusTarget () throws QueryException {
-        String filepath = getClass().getResource(
-                "/queries/relation/focus-target.json").getFile();
+        String filepath = getClass()
+                .getResource("/queries/relation/focus-target.json").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -189,8 +199,9 @@
 
     @Test
     public void testFocusEmptyTarget () throws QueryException {
-        String filepath = getClass().getResource(
-                "/queries/relation/focus-empty-target.json").getFile();
+        String filepath = getClass()
+                .getResource("/queries/relation/focus-empty-target.json")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -201,8 +212,9 @@
 
     @Test
     public void testFocusEmptyBoth () throws QueryException {
-        String filepath = getClass().getResource(
-                "/queries/relation/focus-empty-both.json").getFile();
+        String filepath = getClass()
+                .getResource("/queries/relation/focus-empty-both.json")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestSpanSegmentAlterQuery.java b/src/test/java/de/ids_mannheim/korap/query/TestSpanSegmentAlterQuery.java
index 9791fa4..f509acb 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestSpanSegmentAlterQuery.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestSpanSegmentAlterQuery.java
@@ -29,8 +29,8 @@
 
         SpanAlterQueryWrapper ssaquery = new SpanAlterQueryWrapper("field");
         ssaquery.or("b").or("c");
-        assertEquals("spanOr([field:b, field:c])", ssaquery.toQuery()
-                .toString());
+        assertEquals("spanOr([field:b, field:c])",
+                ssaquery.toQuery().toString());
     };
 
 
@@ -38,8 +38,8 @@
     public void spanAlterQuery3 () throws QueryException {
         SpanAlterQueryWrapper ssaquery = new SpanAlterQueryWrapper("field");
         ssaquery.or("b").or("c").or("d");
-        assertEquals("spanOr([field:b, field:c, field:d])", ssaquery.toQuery()
-                .toString());
+        assertEquals("spanOr([field:b, field:c, field:d])",
+                ssaquery.toQuery().toString());
     };
 
 
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestSpanSegmentQuery.java b/src/test/java/de/ids_mannheim/korap/query/TestSpanSegmentQuery.java
index 8c857a2..791af7c 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestSpanSegmentQuery.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestSpanSegmentQuery.java
@@ -23,8 +23,8 @@
         assertEquals("field:a", ssquery.toQuery().toString());
 
         ssquery = new SpanSegmentQueryWrapper("field", "a", "b");
-        assertEquals("spanSegment(field:a, field:b)", ssquery.toQuery()
-                .toString());
+        assertEquals("spanSegment(field:a, field:b)",
+                ssquery.toQuery().toString());
 
         ssquery = new SpanSegmentQueryWrapper("field", "a", "b", "c");
         assertEquals("spanSegment(spanSegment(field:a, field:b), field:c)",
@@ -40,8 +40,8 @@
         assertEquals("field:a", ssquery.toQuery().toString());
 
         ssquery = new SpanSegmentQueryWrapper("field", "a", "b");
-        assertEquals("spanSegment(field:a, field:b)", ssquery.toQuery()
-                .toString());
+        assertEquals("spanSegment(field:a, field:b)",
+                ssquery.toQuery().toString());
 
         ssquery.without("c");
         assertEquals("spanNot(spanSegment(field:a, field:b), field:c, 0, 0)",
@@ -114,18 +114,18 @@
     public void spanSegmentCloneQuery () throws QueryException {
         SpanSegmentQueryWrapper ssquery = new SpanSegmentQueryWrapper("field",
                 "a", "b");
-        assertEquals("spanSegment(field:a, field:b)", ssquery.toQuery()
-                .toString());
+        assertEquals("spanSegment(field:a, field:b)",
+                ssquery.toQuery().toString());
 
         SpanSegmentQueryWrapper ssquery2 = new SpanSegmentQueryWrapper("field",
                 ssquery);
-        assertEquals(ssquery.toQuery().toString(), ssquery2.toQuery()
-                .toString());
+        assertEquals(ssquery.toQuery().toString(),
+                ssquery2.toQuery().toString());
 
         SpanSegmentQueryWrapper ssquery3 = ssquery2.clone();
-        assertEquals(ssquery.toQuery().toString(), ssquery3.toQuery()
-                .toString());
-        assertEquals(ssquery2.toQuery().toString(), ssquery3.toQuery()
-                .toString());
+        assertEquals(ssquery.toQuery().toString(),
+                ssquery3.toQuery().toString());
+        assertEquals(ssquery2.toQuery().toString(),
+                ssquery3.toQuery().toString());
     };
 };
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestSpanSegmentSequenceQuery.java b/src/test/java/de/ids_mannheim/korap/query/TestSpanSegmentSequenceQuery.java
index 94b3437..5230ed0 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestSpanSegmentSequenceQuery.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestSpanSegmentSequenceQuery.java
@@ -29,15 +29,15 @@
 
         sssq.append("c");
 
-        assertEquals("spanNext(spanNext(field:a, field:b), field:c)", sssq
-                .toQuery().toString());
+        assertEquals("spanNext(spanNext(field:a, field:b), field:c)",
+                sssq.toQuery().toString());
     };
 
 
     @Test
     public void spanSegmentSequenceQuery2 () throws QueryException {
-        SpanSegmentQueryWrapper ssq = new SpanSegmentQueryWrapper("field",
-                "-c", "-d", "-e");
+        SpanSegmentQueryWrapper ssq = new SpanSegmentQueryWrapper("field", "-c",
+                "-d", "-e");
         SpanSequenceQueryWrapper sssq = new SpanSequenceQueryWrapper("field",
                 "a", "b");
 
@@ -54,7 +54,8 @@
     public void spanSegmentSequenceQuery3 () throws QueryException {
         SpanSequenceQueryWrapper sssq = new SpanSequenceQueryWrapper("field",
                 "a", "b");
-        SpanRegexQueryWrapper ssreq = new SpanRegexQueryWrapper("field", "c.?d");
+        SpanRegexQueryWrapper ssreq = new SpanRegexQueryWrapper("field",
+                "c.?d");
 
         sssq.append(ssreq);
 
@@ -71,8 +72,8 @@
 
         sssq.prepend("a");
 
-        assertEquals("spanNext(spanNext(field:a, field:b), field:c)", sssq
-                .toQuery().toString());
+        assertEquals("spanNext(spanNext(field:a, field:b), field:c)",
+                sssq.toQuery().toString());
     };
 
 
@@ -80,8 +81,8 @@
     public void spanSegmentSequenceQueryPrepend2 () throws QueryException {
         SpanSequenceQueryWrapper sssq = new SpanSequenceQueryWrapper("field",
                 "d", "e");
-        SpanSegmentQueryWrapper ssq = new SpanSegmentQueryWrapper("field",
-                "-a", "-b", "-c");
+        SpanSegmentQueryWrapper ssq = new SpanSegmentQueryWrapper("field", "-a",
+                "-b", "-c");
 
         sssq.prepend(ssq);
 
@@ -95,7 +96,8 @@
     public void spanSegmentSequenceQueryPrepend3 () throws QueryException {
         SpanSequenceQueryWrapper sssq = new SpanSequenceQueryWrapper("field",
                 "c", "d");
-        SpanRegexQueryWrapper ssreq = new SpanRegexQueryWrapper("field", "a.?b");
+        SpanRegexQueryWrapper ssreq = new SpanRegexQueryWrapper("field",
+                "a.?b");
 
         sssq.prepend(ssreq);
 
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestSpanSequenceQuery.java b/src/test/java/de/ids_mannheim/korap/query/TestSpanSequenceQuery.java
index 1c6deaf..912642a 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestSpanSequenceQuery.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestSpanSequenceQuery.java
@@ -32,8 +32,8 @@
         assertFalse(sssq.hasConstraints());
 
         sssq.append("c");
-        assertEquals("spanNext(spanNext(field:a, field:b), field:c)", sssq
-                .toQuery().toString());
+        assertEquals("spanNext(spanNext(field:a, field:b), field:c)",
+                sssq.toQuery().toString());
         assertFalse(sssq.hasConstraints());
 
         sssq = new SpanSequenceQueryWrapper("field");
@@ -74,14 +74,14 @@
 
         // Synopsis 1
         ssqw = new SpanSequenceQueryWrapper("tokens", "der", "Baum");
-        assertEquals("spanNext(tokens:der, tokens:Baum)", ssqw.toQuery()
-                .toString());
+        assertEquals("spanNext(tokens:der, tokens:Baum)",
+                ssqw.toQuery().toString());
 
         // Synopsis 2
         ssqw = new SpanSequenceQueryWrapper("tokens");
         ssqw.append("der").append("Baum");
-        assertEquals("spanNext(tokens:der, tokens:Baum)", ssqw.toQuery()
-                .toString());
+        assertEquals("spanNext(tokens:der, tokens:Baum)",
+                ssqw.toQuery().toString());
 
         // Append a sequence
         ssqw = new SpanSequenceQueryWrapper("tokens");
@@ -97,8 +97,8 @@
         // Synopsis 3
         ssqw = new SpanSequenceQueryWrapper("tokens", "Baum");
         ssqw.prepend("der");
-        assertEquals("spanNext(tokens:der, tokens:Baum)", ssqw.toQuery()
-                .toString());
+        assertEquals("spanNext(tokens:der, tokens:Baum)",
+                ssqw.toQuery().toString());
 
         // Prepend a sequence
         ssqw = new SpanSequenceQueryWrapper("tokens");
@@ -115,16 +115,17 @@
         // Add constraint
         ssqw.withConstraint(2, 4);
         // This may change
-        assertEquals("spanDistance(spanDistance(spanDistance(tokens:der, "
-                + "tokens:Baum, [(w[2:4], ordered, notExcluded)]), "
-                + "tokens:fiel, [(w[2:4], ordered, notExcluded)]), "
-                + "tokens:still, [(w[2:4], ordered, notExcluded)])", ssqw
-                .toQuery().toString());
+        assertEquals(
+                "spanDistance(spanDistance(spanDistance(tokens:der, "
+                        + "tokens:Baum, [(w[2:4], ordered, notExcluded)]), "
+                        + "tokens:fiel, [(w[2:4], ordered, notExcluded)]), "
+                        + "tokens:still, [(w[2:4], ordered, notExcluded)])",
+                ssqw.toQuery().toString());
 
         ssqw = new SpanSequenceQueryWrapper("tokens", "der", "Baum")
                 .withConstraint(1, 1);
-        assertEquals("spanNext(tokens:der, tokens:Baum)", ssqw.toQuery()
-                .toString());
+        assertEquals("spanNext(tokens:der, tokens:Baum)",
+                ssqw.toQuery().toString());
 
         ssqw = new SpanSequenceQueryWrapper("tokens", "der", "Baum")
                 .withConstraint(1, 2, "s");
@@ -134,16 +135,20 @@
 
         ssqw = new SpanSequenceQueryWrapper("tokens", "der", "Baum")
                 .withConstraint(1, 2, "s").withConstraint(2, 3, "x");
-        assertEquals("spanMultipleDistance(tokens:der, tokens:Baum, "
-                + "[(s[1:2], ordered, notExcluded), "
-                + "(x[2:3], ordered, notExcluded)])", ssqw.toQuery().toString());
+        assertEquals(
+                "spanMultipleDistance(tokens:der, tokens:Baum, "
+                        + "[(s[1:2], ordered, notExcluded), "
+                        + "(x[2:3], ordered, notExcluded)])",
+                ssqw.toQuery().toString());
 
         ssqw = new SpanSequenceQueryWrapper("tokens").append("Baum")
                 .prepend("der").withConstraint(1, 2, "s", true)
                 .withConstraint(2, 3, "x");
-        assertEquals("spanMultipleDistance(tokens:der, "
-                + "tokens:Baum, [(s[1:2], ordered, excluded), "
-                + "(x[2:3], ordered, notExcluded)])", ssqw.toQuery().toString());
+        assertEquals(
+                "spanMultipleDistance(tokens:der, "
+                        + "tokens:Baum, [(s[1:2], ordered, excluded), "
+                        + "(x[2:3], ordered, notExcluded)])",
+                ssqw.toQuery().toString());
 
 
         // Support empty class ins sequence 
@@ -151,8 +156,8 @@
         srqw = new SpanRepetitionQueryWrapper();
         scqw = new SpanClassQueryWrapper(srqw, (short) 3);
         ssqw.append(scqw);
-        assertEquals("spanExpansion(field:Der, []{1, 1}, right, class:3)", ssqw
-                .toQuery().toString());
+        assertEquals("spanExpansion(field:Der, []{1, 1}, right, class:3)",
+                ssqw.toQuery().toString());
 
         // Support empty class ins sequence 
         ssqw = new SpanSequenceQueryWrapper("field");
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestSpanSequenceQueryJSON.java b/src/test/java/de/ids_mannheim/korap/query/TestSpanSequenceQueryJSON.java
index aff5cf8..6501d77 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestSpanSequenceQueryJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestSpanSequenceQueryJSON.java
@@ -37,8 +37,7 @@
     @Test
     public void queryJSONseqEmptyEnd () throws QueryException {
         SpanQueryWrapper sqwi = jsonQueryFile("empty-last.jsonld");
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:s:der, []{1, 1}, right)}))");
     };
 
@@ -47,8 +46,7 @@
     public void queryJSONseqEmptyEndClass () throws QueryException {
         SpanQueryWrapper sqwi = jsonQueryFile("empty-last-class.jsonld");
         // der{3:[]}
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:s:der, []{1, 1}, right, class:3)}))");
     };
 
@@ -57,8 +55,7 @@
     public void queryJSONseqEmptyEndRepetition () throws QueryException {
         SpanQueryWrapper sqwi = jsonQueryFile("empty-last-repetition.jsonld");
         // der[]{3,5}
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:s:der, []{3, 5}, right)}))");
     };
 
@@ -92,7 +89,8 @@
 
     @Test
     public void queryJSONseqEmptyStartRepetition2 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQueryFile("empty-first-repetition-2.jsonld");
+        SpanQueryWrapper sqwi = jsonQueryFile(
+                "empty-first-repetition-2.jsonld");
         // []{0,0}[tt/p=NN]
         assertEquals(sqwi.toQuery().toString(), "tokens:tt/p:NN");
     };
@@ -111,8 +109,7 @@
     public void queryJSONseqEmptyMiddleClass () throws QueryException {
         SpanQueryWrapper sqwi = jsonQueryFile("empty-middle-class.jsonld");
         // der{1:[]}[tt/p=NN]
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "spanNext(tokens:s:der, spanExpansion(tokens:tt/p:NN, []{1, 1}, left, class:1))");
     };
 
@@ -130,8 +127,7 @@
     public void queryJSONseqEmptySurround () throws QueryException {
         SpanQueryWrapper sqwi = jsonQueryFile("empty-surround.jsonld");
         // [][tt/p=NN][]
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(spanExpansion(tokens:tt/p:NN, []{1, 1}, left), []{1, 1}, right)}))");
     };
 
@@ -140,8 +136,7 @@
     public void queryJSONseqEmptySurroundClass () throws QueryException {
         SpanQueryWrapper sqwi = jsonQueryFile("empty-surround-class.jsonld");
         // [][tt/p=NN]{2:[]}
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(spanExpansion(tokens:tt/p:NN, []{1, 1}, left), []{1, 1}, right, class:2)}))");
     };
 
@@ -150,28 +145,27 @@
     public void queryJSONseqEmptySurroundClass2 () throws QueryException {
         SpanQueryWrapper sqwi = jsonQueryFile("empty-surround-class-2.jsonld");
         // {3:[]}[tt/p=NN]{2:[]}
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(spanExpansion(tokens:tt/p:NN, []{1, 1}, left, class:3), []{1, 1}, right, class:2)}))");
     };
 
 
     @Test
     public void queryJSONseqEmptySurroundRepetition () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQueryFile("empty-surround-repetition.jsonld");
+        SpanQueryWrapper sqwi = jsonQueryFile(
+                "empty-surround-repetition.jsonld");
         // [][tt/p=NN][]{2,7}
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(spanExpansion(tokens:tt/p:NN, []{1, 1}, left), []{2, 7}, right)}))");
     };
 
 
     @Test
     public void queryJSONseqEmptySurroundRepetition2 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQueryFile("empty-surround-repetition-2.jsonld");
+        SpanQueryWrapper sqwi = jsonQueryFile(
+                "empty-surround-repetition-2.jsonld");
         // []{3,5}[tt/p=NN][]{2,7}
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(spanExpansion(tokens:tt/p:NN, []{3, 5}, left), []{2, 7}, right)}))");
     };
 
@@ -179,12 +173,12 @@
     @Test
     public void queryJSONseqEmptySurroundRepetitionClass ()
             throws QueryException {
-        SpanQueryWrapper sqwi = jsonQueryFile("empty-surround-repetition-class.jsonld");
+        SpanQueryWrapper sqwi = jsonQueryFile(
+                "empty-surround-repetition-class.jsonld");
         // {1:[]}{3,8}[tt/p=NN]{2:[]{2,7}}
         // Ist gleichbedeutend mit
         // {1:[]{3,8}}[tt/p=NN]{2:[]}{2,7}
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(spanExpansion(tokens:tt/p:NN, []{3, 8}, left, class:1), []{2, 7}, right, class:2)}))");
     };
 
@@ -210,15 +204,15 @@
     public void queryJSONseqNegativeEnd () throws QueryException {
         SpanQueryWrapper sqwi = jsonQueryFile("negative-last.jsonld");
         // [tt/p=NN][tt/p!=NN]
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:tt/p:NN, !tokens:tt/p:NN{1, 1}, right)}))");
     };
 
 
     @Test
     public void queryJSONseqNegativeStartRepetition () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQueryFile("negative-first-repetition.jsonld");
+        SpanQueryWrapper sqwi = jsonQueryFile(
+                "negative-first-repetition.jsonld");
         // [tt/p!=NN]{4,5}[tt/p=NN]
         assertEquals(sqwi.toQuery().toString(),
                 "spanExpansion(tokens:tt/p:NN, !tokens:tt/p:NN{4, 5}, left)");
@@ -227,7 +221,8 @@
 
     @Test
     public void queryJSONseqNegativeStartRepetition2 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQueryFile("negative-first-repetition-2.jsonld");
+        SpanQueryWrapper sqwi = jsonQueryFile(
+                "negative-first-repetition-2.jsonld");
         // [tt/p!=NN]{0,5}[tt/p=NN]
         assertEquals(sqwi.toQuery().toString(),
                 "spanExpansion(tokens:tt/p:NN, !tokens:tt/p:NN{0, 5}, left)");
@@ -236,7 +231,8 @@
 
     @Test
     public void queryJSONseqNegativeStartRepetition3 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQueryFile("negative-first-repetition-3.jsonld");
+        SpanQueryWrapper sqwi = jsonQueryFile(
+                "negative-first-repetition-3.jsonld");
         // [tt/p!=NN]{0,0}[tt/p=NN]
         assertEquals(sqwi.toQuery().toString(), "tokens:tt/p:NN");
     };
@@ -247,18 +243,18 @@
         SpanQueryWrapper sqwi = jsonQueryFile("negative-last-class.jsonld");
         // [tt/p=NN]{2:[tt/p!=NN]}
         SpanQuery sq = sqwi.toQuery();
-        assertEquals(
-                sq.toString(),
+        assertEquals(sq.toString(),
                 "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:tt/p:NN, !tokens:tt/p:NN{1, 1}, right, class:2)}))");
     };
 
 
     @Test
-    public void queryJSONseqNegativeEndRepetitionClass () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQueryFile("negative-last-class-repetition.jsonld");
+    public void queryJSONseqNegativeEndRepetitionClass ()
+            throws QueryException {
+        SpanQueryWrapper sqwi = jsonQueryFile(
+                "negative-last-class-repetition.jsonld");
         // [tt/p=NN]{2:[tt/p!=NN]{4,5}}
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:tt/p:NN, !tokens:tt/p:NN{4, 5}, right, class:2)}))");
     };
 
@@ -266,17 +262,18 @@
     @Test
     public void queryJSONseqNegativeEndRepetitionClass2 ()
             throws QueryException {
-        SpanQueryWrapper sqwi = jsonQueryFile("negative-last-class-repetition-2.jsonld");
+        SpanQueryWrapper sqwi = jsonQueryFile(
+                "negative-last-class-repetition-2.jsonld");
         // [tt/p=NN]{2:[tt/p!=NN]}{4,5}
-        assertEquals(
-                sqwi.toQuery().toString(),
+        assertEquals(sqwi.toQuery().toString(),
                 "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:tt/p:NN, !tokens:tt/p:NN{4, 5}, right, class:2)}))");
     };
 
 
     @Test
     public void queryJSONseqNegativelastConstraint () {
-        SpanQueryWrapper sqwi = jsonQueryFile("negative-last-constraint.jsonld");
+        SpanQueryWrapper sqwi = jsonQueryFile(
+                "negative-last-constraint.jsonld");
         try {
             sqwi.toQuery().toString();
             fail("Should throw an exception");
@@ -301,7 +298,8 @@
 
     @Test
     public void queryJSONseqNegativeEndSequence2 () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQueryFile("negative-last-sequence-2.jsonld");
+        SpanQueryWrapper sqwi = jsonQueryFile(
+                "negative-last-sequence-2.jsonld");
         // [tt/p!=NN]([tt/p!=DET][tt/p=NN])
 
         // spanNext(tokens:tt/p:NN, 
@@ -334,7 +332,8 @@
 
     @Test
     public void queryJSONseqSentenceDistanceExcluded () throws QueryException {
-        SpanQueryWrapper sqwi = jsonQueryFile("distance-sentence-excluded.jsonld");
+        SpanQueryWrapper sqwi = jsonQueryFile(
+                "distance-sentence-excluded.jsonld");
 
         assertEquals(
                 "spanElementDistance({129: tokens:s:der}, {129: tokens:s:Baum}, [(base/s:s[0:0], notOrdered, excluded)])",
@@ -356,7 +355,8 @@
     public void queryJSONkoralOptionalityInDistanceBug () {
         try {
             // Sonne [] Mond?
-            SpanQueryWrapper sqwi = jsonQueryFile("distance-with-optionality.jsonld");
+            SpanQueryWrapper sqwi = jsonQueryFile(
+                    "distance-with-optionality.jsonld");
             sqwi.toQuery().toString();
         }
         catch (QueryException qe) {
@@ -369,12 +369,14 @@
 
 
     @Test
-    public void queryJSONkoralOptionalityAfterEmptyBug () throws QueryException {
+    public void queryJSONkoralOptionalityAfterEmptyBug ()
+            throws QueryException {
         // Sonne [] Mond?
-        SpanQueryWrapper sqwi = jsonQueryFile("empty-followed-by-optionality.jsonld");
+        SpanQueryWrapper sqwi = jsonQueryFile(
+                "empty-followed-by-optionality.jsonld");
         assertEquals(
-			"focus(254: spanContain(<tokens:base/s:t />, {254: spanOr([spanExpansion(tokens:s:Sonne, []{1, 1}, right), spanNext(spanExpansion(tokens:s:Sonne, []{1, 1}, right), tokens:s:Mond)])}))",
-			sqwi.toQuery().toString());
+                "focus(254: spanContain(<tokens:base/s:t />, {254: spanOr([spanExpansion(tokens:s:Sonne, []{1, 1}, right), spanNext(spanExpansion(tokens:s:Sonne, []{1, 1}, right), tokens:s:Mond)])}))",
+                sqwi.toQuery().toString());
         // Could also be a distance at the end ... that's a query planner thing.
     };
 
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestSpanSubspanQueryJSON.java b/src/test/java/de/ids_mannheim/korap/query/TestSpanSubspanQueryJSON.java
index 2713702..a1b386d 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestSpanSubspanQueryJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestSpanSubspanQueryJSON.java
@@ -17,8 +17,8 @@
     @Test
     public void testTermQuery () throws QueryException {
         // subspan(tokens:tt/l:Haus, 0, 1)
-        String filepath = getClass().getResource(
-                "/queries/submatch/termquery.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/termquery.jsonld").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals("tokens:tt/l:Haus", sq.toString());
@@ -28,8 +28,9 @@
     @Test
     public void testTermStartOffset () throws QueryException {
         // subspan(tokens:tt/l:Haus, -1, 0)
-        String filepath = getClass().getResource(
-                "/queries/submatch/term-start-offset.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/term-start-offset.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals("tokens:tt/l:Haus", sq.toString());
@@ -39,8 +40,8 @@
     @Test
     public void testTermNull () throws QueryException {
         // subspan(tokens:tt/l:Haus, 1, 1)
-        String filepath = getClass().getResource(
-                "/queries/submatch/term-null.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/term-null.jsonld").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(null, sq);
@@ -50,8 +51,9 @@
     @Test
     public void testElementQuery () throws QueryException {
         // submatch(1,4:<s>)
-        String filepath = getClass().getResource(
-                "/queries/submatch/simpleElement.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/simpleElement.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -63,8 +65,8 @@
     @Test
     public void testNoLength () throws QueryException {
         // submatch(1,:<s>)
-        String filepath = getClass().getResource(
-                "/queries/submatch/noLength.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/noLength.jsonld").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals("subspan(<tokens:s />, 1, 0)", sq.toString());
@@ -74,8 +76,8 @@
     @Test
     public void testMinusStartOffset () throws QueryException {
         // submatch(-1,4:<s>)
-        String filepath = getClass().getResource(
-                "/queries/submatch/minusStart.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/minusStart.jsonld").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals("subspan(<tokens:s />, -1, 4)", sq.toString());
@@ -86,8 +88,9 @@
     public void testEmptyMinusStartOffset () throws QueryException {
         // no optimization
         // submatch(-1,4:der []{1,8})
-        String filepath = getClass().getResource(
-                "/queries/submatch/empty-minusStart.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/empty-minusStart.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -100,8 +103,8 @@
     public void testEmptyMax () throws QueryException {
         // no optimization
         // submatch(1,2:der []{1,8})
-        String filepath = getClass().getResource(
-                "/queries/submatch/empty-max.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/empty-max.jsonld").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -112,8 +115,8 @@
 
     @Test
     public void testCaseEmptyWrapped () throws QueryException {
-        String filepath = getClass().getResource(
-                "/queries/submatch/wrapped.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/wrapped.jsonld").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -126,12 +129,14 @@
     @Test
     public void testCaseEmptyEmbedded () throws QueryException {
         // die subspan(der []{1,}, 2,3)
-        String filepath = getClass().getResource(
-                "/queries/submatch/embedded.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/embedded.jsonld").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
-        assertEquals("spanNext({1: tokens:s:die}, {1: subspan(spanExpansion("
-                + "tokens:s:der, []{1, 100}, right), 2, 3)})", sq.toString());
+        assertEquals(
+                "spanNext({1: tokens:s:die}, {1: subspan(spanExpansion("
+                        + "tokens:s:der, []{1, 100}, right), 2, 3)})",
+                sq.toString());
     }
 
 
@@ -139,8 +144,9 @@
     public void testCaseEmptyEmbeddedNull () throws QueryException {
         // die subspan([],5,6)
         // start offset is bigger than the original span
-        String filepath = getClass().getResource(
-                "/queries/submatch/embedded-null.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/embedded-null.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals("tokens:s:die", sq.toString());
@@ -150,8 +156,9 @@
     @Test
     public void testCaseEmptyEmbeddedValid () throws QueryException {
         // die subspan([]{0,5},2)
-        String filepath = getClass().getResource(
-                "/queries/submatch/embedded-valid-empty.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/embedded-valid-empty.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -163,8 +170,9 @@
     @Test
     public void testNegativeToken () throws QueryException {
         // submatch(0,1:[base != Baum])
-        String filepath = getClass().getResource(
-                "/queries/submatch/negative-token.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/negative-token.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals("tokens:l:Baum", sq.toString());
@@ -174,8 +182,8 @@
     @Test
     public void testNegativeSequence () throws QueryException {
         // das submatch(0,1:[base != Baum])
-        String filepath = getClass().getResource(
-                "/queries/submatch/negative-seq.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/negative-seq.jsonld").getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -187,8 +195,9 @@
     @Test
     public void testNegativeSequenceWithClass () throws QueryException {
         // das {1:submatch(0,1:[base != Baum])}
-        String filepath = getClass().getResource(
-                "/queries/submatch/negative-sequence-class.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/negative-sequence-class.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -200,8 +209,9 @@
     @Test
     public void testNegativeEmbeddedSequence () throws QueryException {
         // submatch(1,1:das [base != Baum])
-        String filepath = getClass().getResource(
-                "/queries/submatch/embedded-negative-seq.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/embedded-negative-seq.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -213,8 +223,9 @@
     @Test
     public void testNegativeEmbeddedSequenceWithClass () throws QueryException {
         // submatch(0,1:{1:[base != Baum] dass})
-        String filepath = getClass().getResource(
-                "/queries/submatch/embedded-negative-class-seq.jsonld")
+        String filepath = getClass()
+                .getResource(
+                        "/queries/submatch/embedded-negative-class-seq.jsonld")
                 .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
@@ -227,8 +238,9 @@
     @Test
     public void testEmbeddedNegativeRepetition () throws QueryException {
         // submatch(1,1:das [base != Baum]{1,3})
-        String filepath = getClass().getResource(
-                "/queries/submatch/embedded-negative-repetition.jsonld")
+        String filepath = getClass()
+                .getResource(
+                        "/queries/submatch/embedded-negative-repetition.jsonld")
                 .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
@@ -241,8 +253,9 @@
     @Test
     public void testNegativeRepetition () throws QueryException {
         // das submatch(1,4:[base != Baum]{1,3})
-        String filepath = getClass().getResource(
-                "/queries/submatch/negative-repetition.jsonld").getFile();
+        String filepath = getClass()
+                .getResource("/queries/submatch/negative-repetition.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestSpanWithAttributeJSON.java b/src/test/java/de/ids_mannheim/korap/query/TestSpanWithAttributeJSON.java
index 7e146ad..10b80c7 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestSpanWithAttributeJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestSpanWithAttributeJSON.java
@@ -13,8 +13,10 @@
 
     @Test
     public void testElementSingleAttribute () throws QueryException {
-        String filepath = getClass().getResource(
-                "/queries/attribute/element-single-attribute.jsonld").getFile();
+        String filepath = getClass()
+                .getResource(
+                        "/queries/attribute/element-single-attribute.jsonld")
+                .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
         assertEquals(
@@ -25,8 +27,9 @@
 
     @Test
     public void testElementSingleNotAttribute () throws QueryException {
-        String filepath = getClass().getResource(
-                "/queries/attribute/element-single-not-attribute.jsonld")
+        String filepath = getClass()
+                .getResource(
+                        "/queries/attribute/element-single-not-attribute.jsonld")
                 .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
@@ -53,8 +56,9 @@
 
     @Test
     public void testElementMultipleOrAttributes () throws QueryException {
-        String filepath = getClass().getResource(
-                "/queries/attribute/element-multiple-or-attributes.jsonld")
+        String filepath = getClass()
+                .getResource(
+                        "/queries/attribute/element-multiple-or-attributes.jsonld")
                 .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
@@ -68,8 +72,9 @@
 
     @Test
     public void testAnyElementWithAttribute () throws QueryException {
-        String filepath = getClass().getResource(
-                "/queries/attribute/any-element-with-attribute.jsonld")
+        String filepath = getClass()
+                .getResource(
+                        "/queries/attribute/any-element-with-attribute.jsonld")
                 .getFile();
         SpanQueryWrapper sqwi = getJSONQuery(filepath);
         SpanQuery sq = sqwi.toQuery();
@@ -79,7 +84,8 @@
 
 
     @Test
-    public void testAnyElementWithMultipleOrAttributes () throws QueryException {
+    public void testAnyElementWithMultipleOrAttributes ()
+            throws QueryException {
         String filepath = getClass()
                 .getResource(
                         "/queries/attribute/any-element-with-multiple-or-attributes.jsonld")
@@ -95,7 +101,8 @@
 
 
     @Test
-    public void testAnyElementMultipleAndNotAttributes () throws QueryException {
+    public void testAnyElementMultipleAndNotAttributes ()
+            throws QueryException {
         String filepath = getClass()
                 .getResource(
                         "/queries/attribute/any-element-with-multiple-and-not-attributes.jsonld")
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestSpanWithinQuery.java b/src/test/java/de/ids_mannheim/korap/query/TestSpanWithinQuery.java
index 114ea99..24f296c 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestSpanWithinQuery.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestSpanWithinQuery.java
@@ -18,8 +18,8 @@
     @Test
     public void spanSegmentWithinQuery () throws QueryException {
 
-        SpanSequenceQueryWrapper ssquery = new SpanSequenceQueryWrapper(
-                "field", "a", "b", "c");
+        SpanSequenceQueryWrapper ssquery = new SpanSequenceQueryWrapper("field",
+                "a", "b", "c");
         SpanWithinQuery ssequery = new SpanWithinQuery("s", ssquery.toQuery());
 
         assertEquals(
@@ -37,11 +37,11 @@
     @Test
     public void spanSegmentStartsWithQuery () throws QueryException {
 
-        SpanSequenceQueryWrapper ssquery = new SpanSequenceQueryWrapper(
-                "field", "a", "b", "c");
-        SpanWithinQuery ssequery = new SpanWithinQuery(new SpanElementQuery(
-                "field", "s"), ssquery.toQuery(), SpanWithinQuery.STARTSWITH,
-                true);
+        SpanSequenceQueryWrapper ssquery = new SpanSequenceQueryWrapper("field",
+                "a", "b", "c");
+        SpanWithinQuery ssequery = new SpanWithinQuery(
+                new SpanElementQuery("field", "s"), ssquery.toQuery(),
+                SpanWithinQuery.STARTSWITH, true);
 
         assertEquals(
                 "spanStartsWith(<field:s />, spanNext(spanNext(field:a, field:b), field:c))",
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestTemporaryQueryLimitations.java b/src/test/java/de/ids_mannheim/korap/query/TestTemporaryQueryLimitations.java
index d651318..20cd49f 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestTemporaryQueryLimitations.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestTemporaryQueryLimitations.java
@@ -33,7 +33,8 @@
 public class TestTemporaryQueryLimitations {
 
     @Test
-    public void classRefCheckNotSupported () throws IOException, QueryException {
+    public void classRefCheckNotSupported ()
+            throws IOException, QueryException {
 
         // Construct index
         KrillIndex ki = new KrillIndex();
@@ -48,8 +49,9 @@
         FieldDocument fd = ki.addDoc(json);
         ki.commit();
 
-        json = getJsonString(getClass().getResource(
-                "/queries/bugs/cosmas_classrefcheck.jsonld").getFile());
+        json = getJsonString(getClass()
+                .getResource("/queries/bugs/cosmas_classrefcheck.jsonld")
+                .getFile());
 
         Krill ks = new Krill(json);
         Result kr = ks.apply(ki);
@@ -58,12 +60,13 @@
         assertEquals(kr.getTotalResults(), 0);
         assertEquals(kr.getStartIndex(), 0);
 
-        assertEquals("This is a warning coming from the serialization", kr
-                .getWarning(1).getMessage());
+        assertEquals("This is a warning coming from the serialization",
+                kr.getWarning(1).getMessage());
 
-        assertEquals("Class reference checks are currently not supported"
-                + " - results may not be correct", kr.getWarning(0)
-                .getMessage());
+        assertEquals(
+                "Class reference checks are currently not supported"
+                        + " - results may not be correct",
+                kr.getWarning(0).getMessage());
 
         assertEquals(2, kr.getWarnings().size());
     };
diff --git a/src/test/java/de/ids_mannheim/korap/response/TestMessage.java b/src/test/java/de/ids_mannheim/korap/response/TestMessage.java
index 8da908a..892250d 100644
--- a/src/test/java/de/ids_mannheim/korap/response/TestMessage.java
+++ b/src/test/java/de/ids_mannheim/korap/response/TestMessage.java
@@ -38,8 +38,7 @@
         assertEquals("[[612,\"Foo\"],[613,\"Bar\",\"Instanz\"]]",
                 km.toJsonString());
         km.add(614, "Test");
-        assertEquals(
-                "[[612,\"Foo\"],[613,\"Bar\",\"Instanz\"],[614,\"Test\"]]",
+        assertEquals("[[612,\"Foo\"],[613,\"Bar\",\"Instanz\"],[614,\"Test\"]]",
                 km.toJsonString());
     };
 
diff --git a/src/test/java/de/ids_mannheim/korap/response/TestNotifications.java b/src/test/java/de/ids_mannheim/korap/response/TestNotifications.java
index ed305de..87e09c1 100644
--- a/src/test/java/de/ids_mannheim/korap/response/TestNotifications.java
+++ b/src/test/java/de/ids_mannheim/korap/response/TestNotifications.java
@@ -37,8 +37,9 @@
         notes.addWarning(613, "Foo");
         notes.addWarning(614, "Bar", "Spiel");
 
-        assertEquals("{\"warnings\":[[613,\"Foo\"],[614,\"Bar\","
-                + "\"Spiel\"]]}", notes.toJsonString());
+        assertEquals(
+                "{\"warnings\":[[613,\"Foo\"],[614,\"Bar\"," + "\"Spiel\"]]}",
+                notes.toJsonString());
 
         assertTrue(notes.hasWarnings());
         assertFalse(notes.hasMessages());
diff --git a/src/test/java/de/ids_mannheim/korap/response/TestResponse.java b/src/test/java/de/ids_mannheim/korap/response/TestResponse.java
index c8cf691..a26a945 100644
--- a/src/test/java/de/ids_mannheim/korap/response/TestResponse.java
+++ b/src/test/java/de/ids_mannheim/korap/response/TestResponse.java
@@ -162,7 +162,8 @@
         assertEquals(kresp.getWarning(0).getMessage(), "This is a warning");
         assertEquals(kresp.getWarning(1).getMessage(),
                 "This is a second warning");
-        assertEquals(kresp.getWarning(2).getMessage(), "Response time exceeded");
+        assertEquals(kresp.getWarning(2).getMessage(),
+                "Response time exceeded");
         assertEquals("0.49", kresp.getVersion());
         assertEquals("seaweed", kresp.getName());
         assertEquals("40.5s", kresp.getBenchmark());
diff --git a/src/test/java/de/ids_mannheim/korap/search/TestKrill.java b/src/test/java/de/ids_mannheim/korap/search/TestKrill.java
index ab52dd0..de69724 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestKrill.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestKrill.java
@@ -83,8 +83,7 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
@@ -123,22 +122,21 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
 
-        String json = getJsonString(getClass().getResource(
-                "/queries/metaquery3.jsonld").getFile());
+        String json = getJsonString(
+                getClass().getResource("/queries/metaquery3.jsonld").getFile());
 
         Krill ks = new Krill(json);
         Result kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 66);
         assertEquals(5, kr.getItemsPerPage());
         assertEquals(5, kr.getStartIndex());
-        assertEquals("... a: A ist [[der klangreichste]] der V ...", kr
-                .getMatch(0).getSnippetBrackets());
+        assertEquals("... a: A ist [[der klangreichste]] der V ...",
+                kr.getMatch(0).getSnippetBrackets());
     };
 
 
@@ -149,20 +147,19 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439", "00012-fakemeta", "00030-fakemeta",
-        /*
-          "02035-substring",
-          "05663-unbalanced",
-          "07452-deep"
-        */
+                /*
+                  "02035-substring",
+                  "05663-unbalanced",
+                  "07452-deep"
+                */
         }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
 
-        String json = getJsonString(getClass().getResource(
-                "/queries/metaquery4.jsonld").getFile());
+        String json = getJsonString(
+                getClass().getResource("/queries/metaquery4.jsonld").getFile());
 
         Krill ks = new Krill(json);
         Result kr = ks.apply(ki);
@@ -176,15 +173,15 @@
 
         assertEquals(kr.getTotalResults(), 5);
 
-        json = getJsonString(getClass().getResource("/queries/metaquery5.jsonld")
-                .getFile());
+        json = getJsonString(
+                getClass().getResource("/queries/metaquery5.jsonld").getFile());
 
         ks = new Krill(json);
         kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 1);
 
-        json = getJsonString(getClass().getResource("/queries/metaquery6.jsonld")
-                .getFile());
+        json = getJsonString(
+                getClass().getResource("/queries/metaquery6.jsonld").getFile());
         ks = new Krill(json);
         kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 1);
@@ -207,8 +204,7 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
@@ -225,14 +221,13 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
 
-        String json = getJsonString(getClass().getResource(
-                "/queries/bsp-fail1.jsonld").getFile());
+        String json = getJsonString(
+                getClass().getResource("/queries/bsp-fail1.jsonld").getFile());
 
         Result kr = new Krill(json).apply(ki);
         assertEquals(0, kr.getStartIndex());
@@ -248,14 +243,13 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
 
-        String json = getJsonString(getClass().getResource(
-                "/queries/bsp-fail2.jsonld").getFile());
+        String json = getJsonString(
+                getClass().getResource("/queries/bsp-fail2.jsonld").getFile());
 
         Result kr = new Krill(json).apply(ki);
         assertEquals(50, kr.getItemsPerPage());
@@ -271,8 +265,8 @@
     public void queryJSONmirrorTestBug () throws IOException {
         // Construct index
         KrillIndex ki = new KrillIndex();
-        String json = getJsonString(getClass().getResource(
-                "/queries/bugs/failing_mirror.jsonld").getFile());
+        String json = getJsonString(getClass()
+                .getResource("/queries/bugs/failing_mirror.jsonld").getFile());
         Krill ks = new Krill(json);
         Result kr = ks.apply(ki);
 
@@ -281,8 +275,9 @@
 
         assertEquals("Unable to parse JSON", res.at("/errors/0/1").asText());
 
-        json = getJsonString(getClass().getResource(
-                "/queries/bugs/failing_mirror_2.jsonld").getFile());
+        json = getJsonString(
+                getClass().getResource("/queries/bugs/failing_mirror_2.jsonld")
+                        .getFile());
         ks = new Krill(json);
         kr = ks.apply(ki);
 
@@ -305,23 +300,23 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
 
-        String json = getJsonString(getClass().getResource(
-                "/queries/bsp-context.jsonld").getFile());
+        String json = getJsonString(getClass()
+                .getResource("/queries/bsp-context.jsonld").getFile());
 
         Krill ks = new Krill(json);
         Result kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), 10);
-        assertEquals("A bzw. a ist der erste Buchstabe des"
-                + " lateinischen [[Alphabets]] und ein Vokal."
-                + " Der Buchstabe A hat in deutschen Texten"
-                + " eine durchschnittliche Häufigkeit  ...", kr.getMatch(0)
-                .getSnippetBrackets());
+        assertEquals(
+                "A bzw. a ist der erste Buchstabe des"
+                        + " lateinischen [[Alphabets]] und ein Vokal."
+                        + " Der Buchstabe A hat in deutschen Texten"
+                        + " eine durchschnittliche Häufigkeit  ...",
+                kr.getMatch(0).getSnippetBrackets());
 
         ks.getMeta().setCount(5);
         ks.getMeta().setStartPage(2);
@@ -336,17 +331,19 @@
         kr = new Krill(json).apply(ki);
 
         assertEquals(kr.getTotalResults(), -1);
-        assertEquals("... lls seit den Griechen beibehalten worden."
-                + " 3. Bedeutungen in der Biologie steht A für"
-                + " das Nukleosid Adenosin steht A die Base"
-                + " Adenin steht A für die Aminosäure Alanin"
-                + " in der Informatik steht a für den dezimalen"
-                + " [[Wert]] 97 sowohl im ASCII- als auch im"
-                + " Unicode-Zeichensatz steht A für den dezimalen"
-                + " Wert 65 sowohl im ASCII- als auch im"
-                + " Unicode-Zeichensatz als Kfz-Kennzeichen"
-                + " steht A in Deutschland für Augsburg."
-                + " in Österreich auf ...", kr.getMatch(0).getSnippetBrackets());
+        assertEquals(
+                "... lls seit den Griechen beibehalten worden."
+                        + " 3. Bedeutungen in der Biologie steht A für"
+                        + " das Nukleosid Adenosin steht A die Base"
+                        + " Adenin steht A für die Aminosäure Alanin"
+                        + " in der Informatik steht a für den dezimalen"
+                        + " [[Wert]] 97 sowohl im ASCII- als auch im"
+                        + " Unicode-Zeichensatz steht A für den dezimalen"
+                        + " Wert 65 sowohl im ASCII- als auch im"
+                        + " Unicode-Zeichensatz als Kfz-Kennzeichen"
+                        + " steht A in Deutschland für Augsburg."
+                        + " in Österreich auf ...",
+                kr.getMatch(0).getSnippetBrackets());
     };
 
 
@@ -357,14 +354,13 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
 
-        String json = getJsonString(getClass().getResource(
-                "/queries/bsp-paging.jsonld").getFile());
+        String json = getJsonString(
+                getClass().getResource("/queries/bsp-paging.jsonld").getFile());
 
         Krill ks = new Krill(json);
         Result kr = ks.apply(ki);
@@ -372,16 +368,16 @@
         assertEquals(5, kr.getStartIndex());
         assertEquals(5, kr.getItemsPerPage());
 
-        json = getJsonString(getClass().getResource("/queries/bsp-cutoff.jsonld")
-                .getFile());
+        json = getJsonString(
+                getClass().getResource("/queries/bsp-cutoff.jsonld").getFile());
         ks = ks = new Krill(json);
         kr = ks.apply(ki);
         assertEquals(kr.getTotalResults(), -1);
         assertEquals(2, kr.getStartIndex());
         assertEquals(2, kr.getItemsPerPage());
 
-        json = getJsonString(getClass().getResource("/queries/metaquery9.jsonld")
-                .getFile());
+        json = getJsonString(
+                getClass().getResource("/queries/metaquery9.jsonld").getFile());
         KrillCollection kc = new KrillCollection(json);
         kc.setIndex(ki);
         assertEquals(7, kc.numberOf("documents"));
@@ -395,13 +391,12 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
-        String json = getJsonString(getClass().getResource(
-                "/queries/bsp-itemsPerResource.jsonld").getFile());
+        String json = getJsonString(getClass()
+                .getResource("/queries/bsp-itemsPerResource.jsonld").getFile());
 
         Krill ks = new Krill(json);
         Result kr = ks.apply(ki);
@@ -480,8 +475,8 @@
         };
         ki.commit();
 
-        String json = getJsonString(getClass().getResource(
-                "/queries/bsp-uid-example.jsonld").getFile());
+        String json = getJsonString(getClass()
+                .getResource("/queries/bsp-uid-example.jsonld").getFile());
 
         Krill ks = new Krill(json);
         ks.getMeta().setItemsPerResource(1);
@@ -527,13 +522,14 @@
         assertNull(fd.getTextClass());
         assertEquals(fd.getLanguage(), "de");
         assertEquals(fd.getPubPlace(), "München");
-        assertEquals(fd.getReference(), "Goethe, Johann Wolfgang von:"
-                + " Autobiographische Einzelheiten,"
-                + " (Geschrieben bis 1832), In: Goethe,"
-                + " Johann Wolfgang von: Goethes Werke,"
-                + " Bd. 10, Autobiographische Schriften"
-                + " II, Hrsg.: Trunz, Erich. München: "
-                + "Verlag C. H. Beck, 1982, S. 529-547");
+        assertEquals(fd.getReference(),
+                "Goethe, Johann Wolfgang von:"
+                        + " Autobiographische Einzelheiten,"
+                        + " (Geschrieben bis 1832), In: Goethe,"
+                        + " Johann Wolfgang von: Goethes Werke,"
+                        + " Bd. 10, Autobiographische Schriften"
+                        + " II, Hrsg.: Trunz, Erich. München: "
+                        + "Verlag C. H. Beck, 1982, S. 529-547");
         assertEquals(fd.getPublisher(), "Verlag C. H. Beck");
         assertNull(fd.getEditor());
         assertNull(fd.getFileEditionStatement());
@@ -619,8 +615,7 @@
 
         assertEquals(fd.getTokenSource(), "opennlp#tokens");
 
-        assertEquals(
-                fd.getFoundries(),
+        assertEquals(fd.getFoundries(),
                 "base base/paragraphs base/sentences corenlp "
                         + "corenlp/constituency corenlp/morpho corenlp/namedentities"
                         + " corenlp/sentences glemm glemm/morpho mate mate/morpho"
@@ -665,8 +660,8 @@
                 getClass().getResourceAsStream("/bzk/D59-00089.json.gz"), true);
         ki.commit();
 
-        String json = getJsonString(getClass().getResource(
-                "/queries/bugs/cosmas_boundary.jsonld").getFile());
+        String json = getJsonString(getClass()
+                .getResource("/queries/bugs/cosmas_boundary.jsonld").getFile());
 
         QueryBuilder kq = new QueryBuilder("tokens");
         Krill ks = new Krill(kq.focus(1,
@@ -678,8 +673,7 @@
         assertEquals(40, kr.getMatch(0).getStartPos());
         assertEquals(41, kr.getMatch(0).getEndPos());
 
-        assertEquals(
-                kr.getMatch(0).getSnippetBrackets(),
+        assertEquals(kr.getMatch(0).getSnippetBrackets(),
                 "... Initiative\" eine neue politische Gruppierung ins "
                         + "[[{1:Leben}]] gerufen hatten. Pressemeldungen zufolge haben sich ...");
 
@@ -690,19 +684,16 @@
         kr = ks.apply(ki);
         assertEquals(kr.getSerialQuery(),
                 "focus(129: spanContain(<tokens:base/s:s />, {129: tokens:s:Leben}))");
-        assertEquals(
-                kr.getMatch(0).getSnippetBrackets(),
+        assertEquals(kr.getMatch(0).getSnippetBrackets(),
                 "... Initiative\" eine neue politische Gruppierung ins "
                         + "[[Leben]] gerufen hatten. Pressemeldungen zufolge haben sich ...");
 
         ks = new Krill(json);
         kr = ks.apply(ki);
-        assertEquals(
-                kr.getSerialQuery(),
+        assertEquals(kr.getSerialQuery(),
                 "focus(129: spanElementDistance({129: tokens:s:Namen}, "
                         + "{129: tokens:s:Leben}, [(base/s:s[0:1], notOrdered, notExcluded)]))");
-        assertEquals(
-                kr.getMatch(0).getSnippetBrackets(),
+        assertEquals(kr.getMatch(0).getSnippetBrackets(),
                 "... ihren Austritt erklärt und unter dem [[Namen \"Einheitsbewegung "
                         + "der sozialistischen Initiative\" eine neue politische Gruppierung "
                         + "ins Leben]] gerufen hatten. Pressemeldungen zufolge haben sich ...");
@@ -723,16 +714,16 @@
 
         ki.commit();
 
-        String json = getJsonString(getClass().getResource(
-                "/queries/bugs/multiple_classes.jsonld").getFile());
+        String json = getJsonString(
+                getClass().getResource("/queries/bugs/multiple_classes.jsonld")
+                        .getFile());
 
         Krill ks = new Krill(json);
         Result kr = ks.apply(ki);
         assertEquals(kr.getSerialQuery(),
                 "{4: spanNext({1: spanNext({2: tokens:s:ins}, "
                         + "{3: tokens:s:Leben})}, tokens:s:gerufen)}");
-        assertEquals(
-                kr.getMatch(0).getSnippetBrackets(),
+        assertEquals(kr.getMatch(0).getSnippetBrackets(),
                 "... sozialistischen Initiative\" eine neue politische"
                         + " Gruppierung [[{4:{1:{2:ins} {3:Leben}} gerufen}]] hatten. "
                         + "Pressemeldungen zufolge haben sich in ...");
@@ -753,8 +744,9 @@
 
         ki.commit();
 
-        String json = getJsonString(getClass().getResource(
-                "/queries/bugs/multiple_classes.jsonld").getFile());
+        String json = getJsonString(
+                getClass().getResource("/queries/bugs/multiple_classes.jsonld")
+                        .getFile());
 
         Krill ks = new Krill(json);
         Result kr = ks.apply(ki);
@@ -763,8 +755,9 @@
         JsonNode res = mapper.readTree(kr.toTokenListJsonString());
 
         assertEquals(1, res.at("/meta/totalResults").asInt());
-        assertEquals("{4: spanNext({1: spanNext({2: tokens:s:ins}, "
-                + "{3: tokens:s:Leben})}, tokens:s:gerufen)}",
+        assertEquals(
+                "{4: spanNext({1: spanNext({2: tokens:s:ins}, "
+                        + "{3: tokens:s:Leben})}, tokens:s:gerufen)}",
                 res.at("/meta/serialQuery").asText());
         assertEquals(0, res.at("/meta/startIndex").asInt());
         assertEquals(25, res.at("/meta/itemsPerPage").asInt());
@@ -795,8 +788,9 @@
         assertEquals("BZK", fd.getCorpusSigle());
 
         // [tt/p="A.*"]{0,3}[tt/p="N.*"]
-        String json = getJsonString(getClass().getResource(
-                "/queries/bugs/multiterm_rewrite.jsonld").getFile());
+        String json = getJsonString(
+                getClass().getResource("/queries/bugs/multiterm_rewrite.jsonld")
+                        .getFile());
 
         Krill ks = new Krill(json);
         KrillCollection kc = ks.getCollection();
@@ -839,8 +833,7 @@
         assertEquals(kr.getMatch(3).getSnippetBrackets(),
                 "Saragat-Partei zerfällt Rom ([[ADN]]) "
                         + "die von dem Rechtssozialisten Saragat geführte ...");
-        assertEquals(
-                kr.getMatch(23).getSnippetBrackets(),
+        assertEquals(kr.getMatch(23).getSnippetBrackets(),
                 "... dem Namen \"Einheitsbewegung der sozialistischen "
                         + "Initiative\" [[eine neue politische Gruppierung]] "
                         + "ins Leben gerufen hatten. Pressemeldungen zufolge ...");
@@ -858,8 +851,9 @@
         ki.commit();
 
         // ({1:Sonne []* Erde} | {2: Erde []* Sonne})
-        String json = getJsonString(getClass().getResource(
-                "/queries/bugs/tokendistancespan_bug.jsonld").getFile());
+        String json = getJsonString(getClass()
+                .getResource("/queries/bugs/tokendistancespan_bug.jsonld")
+                .getFile());
 
         Krill ks = new Krill(json);
         Result kr = ks.apply(ki);
@@ -876,13 +870,13 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
-        String json = getJsonString(getClass().getResource(
-                "/queries/metaquery8-nocollection.jsonld").getFile());
+        String json = getJsonString(getClass()
+                .getResource("/queries/metaquery8-nocollection.jsonld")
+                .getFile());
 
         Krill ks = new Krill(json);
         Result kr = ks.apply(ki);
@@ -890,8 +884,8 @@
         assertEquals(0, kr.getStartIndex());
         assertEquals(10, kr.getItemsPerPage());
 
-        json = getJsonString(getClass().getResource("/queries/metaquery8.jsonld")
-                .getFile());
+        json = getJsonString(
+                getClass().getResource("/queries/metaquery8.jsonld").getFile());
 
         ks = new Krill(json);
         kr = ks.apply(ki);
@@ -901,8 +895,8 @@
         assertEquals(0, kr.getStartIndex());
         assertEquals(10, kr.getItemsPerPage());
 
-        json = getJsonString(getClass().getResource(
-                "/queries/metaquery8-filtered.jsonld").getFile());
+        json = getJsonString(getClass()
+                .getResource("/queries/metaquery8-filtered.jsonld").getFile());
 
         ks = new Krill(json);
         kr = ks.apply(ki);
@@ -912,8 +906,9 @@
         assertEquals(0, kr.getStartIndex());
         assertEquals(10, kr.getItemsPerPage());
 
-        json = getJsonString(getClass().getResource(
-                "/queries/metaquery8-filtered-further.jsonld").getFile());
+        json = getJsonString(getClass()
+                .getResource("/queries/metaquery8-filtered-further.jsonld")
+                .getFile());
 
         ks = new Krill(json);
         kr = ks.apply(ki);
@@ -923,8 +918,9 @@
         assertEquals(10, kr.getItemsPerPage());
 
 
-        json = getJsonString(getClass().getResource(
-                "/queries/metaquery8-filtered-nested.jsonld").getFile());
+        json = getJsonString(getClass()
+                .getResource("/queries/metaquery8-filtered-nested.jsonld")
+                .getFile());
 
         ks = new Krill(json);
         kr = ks.apply(ki);
@@ -952,14 +948,13 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
 
-        String json = getJsonString(getClass().getResource(
-                "/queries/bsp-context-2.jsonld").getFile());
+        String json = getJsonString(getClass()
+                .getResource("/queries/bsp-context-2.jsonld").getFile());
 
         Krill ks = new Krill(json);
         ks.getMeta().setCutOff(false);
@@ -975,11 +970,11 @@
         assertEquals(0, kr.getStartIndex());
         assertEquals(25, kr.getItemsPerPage());
 
-        assertFalse(kr.getContext().toJsonNode().toString()
-                .equals("\"base/s:s\""));
+        assertFalse(
+                kr.getContext().toJsonNode().toString().equals("\"base/s:s\""));
 
-        json = getJsonString(getClass().getResource(
-                "/queries/bsp-context-sentence.jsonld").getFile());
+        json = getJsonString(getClass()
+                .getResource("/queries/bsp-context-sentence.jsonld").getFile());
 
         kr = new Krill(json).apply(ki);
         assertEquals(kr.getContext().toJsonNode().toString(), "\"base/s:s\"");
@@ -1004,14 +999,13 @@
         // Indexing test files
         for (String i : new String[] { "00001", "00002", "00003", "00004",
                 "00005", "00006", "02439" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
 
-        String json = getJsonString(getClass().getResource(
-                "/queries/bsp-bug.jsonld").getFile());
+        String json = getJsonString(
+                getClass().getResource("/queries/bsp-bug.jsonld").getFile());
 
         Result kr = new Krill(json).apply(ki);
 
@@ -1027,20 +1021,19 @@
         // Indexing test files
         for (String i : new String[] { "00001" }) {
             // , "00002", "00003", "00004", "00005", "00006", "02439"
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
 
         // "der" []{2,3} [opennlp/p="NN"]
-        String json = getJsonString(getClass().getResource(
-                "/queries/bugs/distances_with_regex_bug.jsonld").getFile());
+        String json = getJsonString(getClass()
+                .getResource("/queries/bugs/distances_with_regex_bug.jsonld")
+                .getFile());
 
         Result kr = new Krill(json).apply(ki);
 
-        assertEquals(
-                kr.getMatch(0).getSnippetBrackets(),
+        assertEquals(kr.getMatch(0).getSnippetBrackets(),
                 "Mit Ausnahme von Fremdwörtern und Namen ist das A der einzige Buchstabe im Deutschen, [[der zweifach am Anfang]] eines Wortes stehen darf, etwa im Wort Aal.");
 
     };
@@ -1059,14 +1052,15 @@
 
         // Expansion bug
         // der alte Digraph Aa durch Å
-        String json = getJsonString(getClass().getResource(
-                "/queries/bugs/expansion_bug_2.jsonld").getFile());
+        String json = getJsonString(getClass()
+                .getResource("/queries/bugs/expansion_bug_2.jsonld").getFile());
 
         Result kr = new Krill(json).apply(ki);
-        assertEquals("... Buchstabe des Alphabetes. In Dänemark ist "
-                + "[[der alte Digraph Aa durch Å]] ersetzt worden, "
-                + "in Eigennamen und Ortsnamen ...", kr.getMatch(0)
-                .getSnippetBrackets());
+        assertEquals(
+                "... Buchstabe des Alphabetes. In Dänemark ist "
+                        + "[[der alte Digraph Aa durch Å]] ersetzt worden, "
+                        + "in Eigennamen und Ortsnamen ...",
+                kr.getMatch(0).getSnippetBrackets());
         assertEquals("WPD_AAA.00002", kr.getMatch(0).getDocID());
         assertEquals(kr.getTotalResults(), 1);
 
@@ -1079,52 +1073,54 @@
 
         // der alte Digraph Aa durch []
         // Works with one document
-        json = getJsonString(getClass().getResource(
-                "/queries/bugs/expansion_bug.jsonld").getFile());
+        json = getJsonString(getClass()
+                .getResource("/queries/bugs/expansion_bug.jsonld").getFile());
 
         kr = new Krill(json).apply(ki);
 
         // focus(254: spanContain(<tokens:base/s:t />, {254: spanNext(spanNext(spanNext(spanNext(tokens:s:der, tokens:s:alte), tokens:s:Digraph), tokens:s:Aa), spanExpansion(tokens:s:durch, []{1, 1}, right))}))
 
-        assertEquals("... Buchstabe des Alphabetes. In Dänemark ist "
-                + "[[der alte Digraph Aa durch Å]] ersetzt worden, "
-                + "in Eigennamen und Ortsnamen ...", kr.getMatch(0)
-                .getSnippetBrackets());
+        assertEquals(
+                "... Buchstabe des Alphabetes. In Dänemark ist "
+                        + "[[der alte Digraph Aa durch Å]] ersetzt worden, "
+                        + "in Eigennamen und Ortsnamen ...",
+                kr.getMatch(0).getSnippetBrackets());
         assertEquals("WPD_AAA.00002", kr.getMatch(0).getDocID());
         assertEquals(kr.getTotalResults(), 1);
 
         // Now try with one file ahead
         ki = new KrillIndex();
         for (String i : new String[] { "00001", "00002" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
 
         // Expansion bug
         // der alte Digraph Aa durch Å
-        json = getJsonString(getClass().getResource(
-                "/queries/bugs/expansion_bug_2.jsonld").getFile());
+        json = getJsonString(getClass()
+                .getResource("/queries/bugs/expansion_bug_2.jsonld").getFile());
 
         kr = new Krill(json).apply(ki);
 
-        assertEquals("... Buchstabe des Alphabetes. In Dänemark ist "
-                + "[[der alte Digraph Aa durch Å]] ersetzt worden, "
-                + "in Eigennamen und Ortsnamen ...", kr.getMatch(0)
-                .getSnippetBrackets());
+        assertEquals(
+                "... Buchstabe des Alphabetes. In Dänemark ist "
+                        + "[[der alte Digraph Aa durch Å]] ersetzt worden, "
+                        + "in Eigennamen und Ortsnamen ...",
+                kr.getMatch(0).getSnippetBrackets());
         assertEquals("WPD_AAA.00002", kr.getMatch(0).getDocID());
         assertEquals(kr.getTotalResults(), 1);
 
         // der alte Digraph Aa durch []
-        json = getJsonString(getClass().getResource(
-                "/queries/bugs/expansion_bug.jsonld").getFile());
+        json = getJsonString(getClass()
+                .getResource("/queries/bugs/expansion_bug.jsonld").getFile());
 
         kr = new Krill(json).apply(ki);
-        assertEquals("... Buchstabe des Alphabetes. In Dänemark ist "
-                + "[[der alte Digraph Aa durch Å]] ersetzt worden, "
-                + "in Eigennamen und Ortsnamen ...", kr.getMatch(0)
-                .getSnippetBrackets());
+        assertEquals(
+                "... Buchstabe des Alphabetes. In Dänemark ist "
+                        + "[[der alte Digraph Aa durch Å]] ersetzt worden, "
+                        + "in Eigennamen und Ortsnamen ...",
+                kr.getMatch(0).getSnippetBrackets());
         assertEquals("WPD_AAA.00002", kr.getMatch(0).getDocID());
         assertEquals(kr.getTotalResults(), 1);
     };
@@ -1137,14 +1133,15 @@
         ki.addDoc(getClass().getResourceAsStream("/wiki/00001.json.gz"), true);
         ki.commit();
 
-        String json = getJsonString(getClass().getResource(
-                "/queries/bugs/zero_repetition_bug.jsonld").getFile());
+        String json = getJsonString(getClass()
+                .getResource("/queries/bugs/zero_repetition_bug.jsonld")
+                .getFile());
 
         Result kr = new Krill(json).apply(ki);
 
         assertEquals(783, kr.getError(0).getCode());
-        assertEquals("This query can't match anywhere", kr.getError(0)
-                .getMessage());
+        assertEquals("This query can't match anywhere",
+                kr.getError(0).getMessage());
     };
 
 
@@ -1157,8 +1154,9 @@
         // Construct index
         KrillIndex ki = new KrillIndex();
         // Indexing test files
-        ki.addDoc(getClass()
-                .getResourceAsStream("/sgbr/BSP-2013-01-32.json.gz"), true);
+        ki.addDoc(
+                getClass().getResourceAsStream("/sgbr/BSP-2013-01-32.json.gz"),
+                true);
         ki.commit();
 
         Krill k = new Krill(new QueryBuilder("tokens").tag("base/s:s"));
diff --git a/src/test/java/de/ids_mannheim/korap/search/TestMetaFields.java b/src/test/java/de/ids_mannheim/korap/search/TestMetaFields.java
index b297672..7a70f13 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestMetaFields.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestMetaFields.java
@@ -41,14 +41,13 @@
         KrillIndex ki = new KrillIndex();
         // Indexing test files
         for (String i : new String[] { "00001", "00002" }) {
-            ki.addDoc(
-                    getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
+            ki.addDoc(getClass().getResourceAsStream("/wiki/" + i + ".json.gz"),
                     true);
         };
         ki.commit();
 
-        String jsonString = getJsonString(getClass().getResource(
-                "/queries/metas/fields.jsonld").getFile());
+        String jsonString = getJsonString(getClass()
+                .getResource("/queries/metas/fields.jsonld").getFile());
 
         Krill ks = new Krill(jsonString);
 
@@ -87,8 +86,8 @@
         assertTrue(res.at("/matches/0/layerInfos").isMissingNode());
         assertTrue(res.at("/matches/0/tokenization").isMissingNode());
 
-        jsonString = getJsonString(getClass().getResource(
-                "/queries/metas/fields_2.jsonld").getFile());
+        jsonString = getJsonString(getClass()
+                .getResource("/queries/metas/fields_2.jsonld").getFile());
         ks = new Krill(jsonString);
         kr = ks.apply(ki);
         assertEquals((long) 17, kr.getTotalResults());
@@ -99,13 +98,13 @@
         res = mapper.readTree(kr.toJsonString());
         assertEquals(0, res.at("/matches/0/UID").asInt());
         assertTrue(res.at("/matches/0/corpusID").isMissingNode());
-        assertEquals("Ruru,Jens.Ol,Aglarech", res.at("/matches/0/author")
-                .asText());
+        assertEquals("Ruru,Jens.Ol,Aglarech",
+                res.at("/matches/0/author").asText());
         assertEquals("A", res.at("/matches/0/title").asText());
         assertEquals("WPD_AAA.00001", res.at("/matches/0/docID").asText());
         assertTrue(res.at("/matches/0/textSigle").isMissingNode());
-        assertEquals("match-WPD_AAA.00001-p6-7", res.at("/matches/0/matchID")
-                .asText());
+        assertEquals("match-WPD_AAA.00001-p6-7",
+                res.at("/matches/0/matchID").asText());
         // assertEquals("p6-7", res.at("/matches/0/matchID").asText());
         assertEquals("", res.at("/matches/0/subTitle").asText());
         assertEquals("", res.at("/matches/0/textClass").asText());
@@ -125,8 +124,8 @@
         ki.addDoc(getClass().getResourceAsStream("/goe/AGX-00002.json"), false);
         ki.commit();
 
-        String jsonString = getJsonString(getClass().getResource(
-                "/queries/metas/fields_no.jsonld").getFile());
+        String jsonString = getJsonString(getClass()
+                .getResource("/queries/metas/fields_no.jsonld").getFile());
 
         Krill ks = new Krill(jsonString);
         Result kr = ks.apply(ki);
@@ -134,85 +133,87 @@
         JsonNode res = mapper.readTree(kr.toJsonString());
         assertEquals(0, res.at("/matches/0/UID").asInt());
         assertEquals("GOE_AGX.00002", res.at("/matches/0/textSigle").asText());
-        assertEquals("Maximen und Reflexionen", res.at("/matches/0/title")
-                .asText());
+        assertEquals("Maximen und Reflexionen",
+                res.at("/matches/0/title").asText());
         assertEquals("1982", res.at("/matches/0/pubDate").asText());
-        assertEquals("Goethe, Johann Wolfgang von", res.at("/matches/0/author")
-                .asText());
+        assertEquals("Goethe, Johann Wolfgang von",
+                res.at("/matches/0/author").asText());
         assertEquals("GOE_AGX", res.at("/matches/0/docSigle").asText());
         assertEquals("GOE", res.at("/matches/0/corpusSigle").asText());
-        assertEquals("Religion und Christentum", res.at("/matches/0/subTitle")
-                .asText());
+        assertEquals("Religion und Christentum",
+                res.at("/matches/0/subTitle").asText());
         assertEquals("München", res.at("/matches/0/pubPlace").asText());
         assertEquals(
                 "base/s=spans cnx/c=spans cnx/l=tokens cnx/m=tokens cnx/p=tokens cnx/s=spans cnx/syn=tokens corenlp/c=spans corenlp/ne=tokens corenlp/p=tokens corenlp/s=spans glemm/l=tokens mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans xip/c=spans xip/l=tokens xip/p=tokens xip/s=spans",
                 res.at("/matches/0/layerInfos").asText());
         assertTrue(res.at("/matches/0/textType").isMissingNode());
-        assertEquals("match-GOE_AGX.00002-p7-8", res.at("/matches/0/matchID")
-                .asText());
+        assertEquals("match-GOE_AGX.00002-p7-8",
+                res.at("/matches/0/matchID").asText());
 
 
         // All fields
-        jsonString = getJsonString(getClass().getResource(
-                "/queries/metas/fields_all.jsonld").getFile());
+        jsonString = getJsonString(getClass()
+                .getResource("/queries/metas/fields_all.jsonld").getFile());
 
         ks = new Krill(jsonString);
         kr = ks.apply(ki);
         mapper = new ObjectMapper();
         res = mapper.readTree(kr.toJsonString());
-        assertEquals("Verlag C. H. Beck", res.at("/matches/0/publisher")
-                .asText());
+        assertEquals("Verlag C. H. Beck",
+                res.at("/matches/0/publisher").asText());
         assertEquals("Aphorismus", res.at("/matches/0/textType").asText());
         assertEquals("Aphorismen", res.at("/matches/0/textTypeRef").asText());
         assertEquals(
                 "Goethe, Johann Wolfgang von: Maximen und Reflexionen. Religion und Christentum, [Aphorismen], (Erstveröffentlichung: Stuttgart ; Tübingen, 1827-1842), In: Goethe, Johann Wolfgang von: Goethes Werke, Bd. 12, Schriften zur Kunst. Schriften zur Literatur. Maximen und Reflexionen, Hrsg.: Trunz, Erich. München: Verlag C. H. Beck, 1982, S. 372-377",
                 res.at("/matches/0/reference").asText());
         assertEquals("de", res.at("/matches/0/language").asText());
-        assertEquals("opennlp#tokens", res.at("/matches/0/tokenSource")
-                .asText());
+        assertEquals("opennlp#tokens",
+                res.at("/matches/0/tokenSource").asText());
         assertEquals(
                 "base base/paragraphs base/sentences connexor connexor/morpho connexor/phrase connexor/sentences connexor/syntax corenlp corenlp/constituency corenlp/morpho corenlp/namedentities corenlp/sentences glemm glemm/morpho mate mate/morpho opennlp opennlp/morpho opennlp/sentences treetagger treetagger/morpho treetagger/sentences xip xip/constituency xip/morpho xip/sentences",
                 res.at("/matches/0/foundries").asText());
-        assertEquals("Goethe-Korpus", res.at("/matches/0/corpusTitle").asText());
+        assertEquals("Goethe-Korpus",
+                res.at("/matches/0/corpusTitle").asText());
         assertEquals("QAO-NC", res.at("/matches/0/license").asText());
         assertEquals("Goethe: Maximen und Reflexionen, (1827-1842)",
                 res.at("/matches/0/docTitle").asText());
         assertEquals("1827", res.at("/matches/0/creationDate").asText());
         assertEquals("372-377", res.at("/matches/0/pages").asText());
-        assertEquals("match-GOE_AGX.00002-p7-8", res.at("/matches/0/matchID")
-                .asText());
+        assertEquals("match-GOE_AGX.00002-p7-8",
+                res.at("/matches/0/matchID").asText());
 
 
         // @All fields
-        jsonString = getJsonString(getClass().getResource(
-                "/queries/metas/fields_at_all.jsonld").getFile());
+        jsonString = getJsonString(getClass()
+                .getResource("/queries/metas/fields_at_all.jsonld").getFile());
 
         ks = new Krill(jsonString);
         kr = ks.apply(ki);
         mapper = new ObjectMapper();
         res = mapper.readTree(kr.toJsonString());
 
-        assertEquals("Verlag C. H. Beck", res.at("/matches/0/publisher")
-                .asText());
+        assertEquals("Verlag C. H. Beck",
+                res.at("/matches/0/publisher").asText());
         assertEquals("Aphorismus", res.at("/matches/0/textType").asText());
         assertEquals("Aphorismen", res.at("/matches/0/textTypeRef").asText());
         assertEquals(
                 "Goethe, Johann Wolfgang von: Maximen und Reflexionen. Religion und Christentum, [Aphorismen], (Erstveröffentlichung: Stuttgart ; Tübingen, 1827-1842), In: Goethe, Johann Wolfgang von: Goethes Werke, Bd. 12, Schriften zur Kunst. Schriften zur Literatur. Maximen und Reflexionen, Hrsg.: Trunz, Erich. München: Verlag C. H. Beck, 1982, S. 372-377",
                 res.at("/matches/0/reference").asText());
         assertEquals("de", res.at("/matches/0/language").asText());
-        assertEquals("opennlp#tokens", res.at("/matches/0/tokenSource")
-                .asText());
+        assertEquals("opennlp#tokens",
+                res.at("/matches/0/tokenSource").asText());
         assertEquals(
                 "base base/paragraphs base/sentences connexor connexor/morpho connexor/phrase connexor/sentences connexor/syntax corenlp corenlp/constituency corenlp/morpho corenlp/namedentities corenlp/sentences glemm glemm/morpho mate mate/morpho opennlp opennlp/morpho opennlp/sentences treetagger treetagger/morpho treetagger/sentences xip xip/constituency xip/morpho xip/sentences",
                 res.at("/matches/0/foundries").asText());
-        assertEquals("Goethe-Korpus", res.at("/matches/0/corpusTitle").asText());
+        assertEquals("Goethe-Korpus",
+                res.at("/matches/0/corpusTitle").asText());
         assertEquals("QAO-NC", res.at("/matches/0/license").asText());
         assertEquals("Goethe: Maximen und Reflexionen, (1827-1842)",
                 res.at("/matches/0/docTitle").asText());
         assertEquals("1827", res.at("/matches/0/creationDate").asText());
         assertEquals("372-377", res.at("/matches/0/pages").asText());
-        assertEquals("match-GOE_AGX.00002-p7-8", res.at("/matches/0/matchID")
-                .asText());
+        assertEquals("match-GOE_AGX.00002-p7-8",
+                res.at("/matches/0/matchID").asText());
     };
 
 
@@ -245,16 +246,19 @@
         ki.commit();
 
         // textClass = reisen & wissenschaft
-        String jsonString = getJsonString(getClass().getResource(
-                "/queries/collections/collection_textClass.jsonld").getFile());
+        String jsonString = getJsonString(getClass()
+                .getResource("/queries/collections/collection_textClass.jsonld")
+                .getFile());
         Krill ks = new Krill(jsonString);
         KrillCollection kc = ks.getCollection();
         kc.setIndex(ki);
         assertEquals(1, kc.numberOf("documents"));
 
         // textClass = reisen
-        jsonString = getJsonString(getClass().getResource(
-                "/queries/collections/collection_textClass_2.jsonld").getFile());
+        jsonString = getJsonString(getClass()
+                .getResource(
+                        "/queries/collections/collection_textClass_2.jsonld")
+                .getFile());
         ks = new Krill(jsonString);
         kc = ks.getCollection();
         kc.setIndex(ki);
@@ -267,7 +271,7 @@
                                                                   );
         // OffsetAttribute offsetAttribute = ts.addAttribute(OffsetAttribute.class);
         CharTermAttribute charTermAttribute = ts.addAttribute(CharTermAttribute.class);
-
+        
         ts.reset();
         while (ts.incrementToken()) {
             String term = charTermAttribute.toString();
@@ -276,16 +280,18 @@
         */
 
         // author = wolfgang
-        jsonString = getJsonString(getClass().getResource(
-                "/queries/collections/collection_goethe.jsonld").getFile());
+        jsonString = getJsonString(getClass()
+                .getResource("/queries/collections/collection_goethe.jsonld")
+                .getFile());
         ks = new Krill(jsonString);
         kc = ks.getCollection();
         kc.setIndex(ki);
         assertEquals(1, kc.numberOf("documents"));
 
         // author = Wolfgang
-        jsonString = getJsonString(getClass().getResource(
-                "/queries/collections/collection_goethe_2.jsonld").getFile());
+        jsonString = getJsonString(getClass()
+                .getResource("/queries/collections/collection_goethe_2.jsonld")
+                .getFile());
         ks = new Krill(jsonString);
         kc = ks.getCollection();
         kc.setIndex(ki);
@@ -303,8 +309,9 @@
     public void searchMetaContext () throws IOException {
 
         // All fields
-        String jsonString = getJsonString(getClass().getResource(
-                "/queries/metas/context_paragraph.jsonld").getFile());
+        String jsonString = getJsonString(getClass()
+                .getResource("/queries/metas/context_paragraph.jsonld")
+                .getFile());
 
         Krill ks = new Krill(jsonString);
         assertTrue(ks.getMeta().getContext().isSpanDefined());
diff --git a/src/test/java/de/ids_mannheim/korap/search/TestResult.java b/src/test/java/de/ids_mannheim/korap/search/TestResult.java
index 12e5b3d..7e1442f 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestResult.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestResult.java
@@ -36,9 +36,9 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
         fd.addString("UID", "1");
-        fd.addTV("base", "abab", "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]"
-                + "[(1-2)s:b|i:b|_1#1-2]" + "[(2-3)s:a|i:c|_2#2-3]"
-                + "[(3-4)s:b|i:a|_3#3-4]");
+        fd.addTV("base", "abab",
+                "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]" + "[(1-2)s:b|i:b|_1#1-2]"
+                        + "[(2-3)s:a|i:c|_2#2-3]" + "[(3-4)s:b|i:a|_3#3-4]");
         ki.addDoc(fd);
         fd = new FieldDocument();
         fd.addString("ID", "doc-2");
@@ -76,8 +76,8 @@
         */
         assertEquals(1, res.at("/matches/0/UID").asInt());
         assertEquals("doc-1", res.at("/matches/0/docID").asText());
-        assertEquals("match-doc-1-p0-1(1)0-0", res.at("/matches/0/matchID")
-                .asText());
+        assertEquals("match-doc-1-p0-1(1)0-0",
+                res.at("/matches/0/matchID").asText());
         assertEquals(
                 "<span class=\"context-left\"></span><span class=\"match\"><mark><mark class=\"class-1 level-0\">a</mark></mark></span><span class=\"context-right\">bab</span>",
                 res.at("/matches/0/snippet").asText());
@@ -90,8 +90,8 @@
         */
         assertEquals(2, res.at("/matches/6/UID").asInt());
         assertEquals("doc-2", res.at("/matches/6/docID").asText());
-        assertEquals("match-doc-2-p2-3(1)2-2", res.at("/matches/6/matchID")
-                .asText());
+        assertEquals("match-doc-2-p2-3(1)2-2",
+                res.at("/matches/6/matchID").asText());
         assertEquals(
                 "<span class=\"context-left\">ab</span><span class=\"match\"><mark><mark class=\"class-1 level-0\">a</mark></mark></span><span class=\"context-right\"></span>",
                 res.at("/matches/6/snippet").asText());
@@ -104,14 +104,15 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
         fd.addString("UID", "1");
-        fd.addTV("tokens", "abab", "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]"
-                + "[(1-2)s:b|i:b|_1#1-2]" + "[(2-3)s:a|i:c|_2#2-3]"
-                + "[(3-4)s:b|i:a|_3#3-4]");
+        fd.addTV("tokens", "abab",
+                "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]" + "[(1-2)s:b|i:b|_1#1-2]"
+                        + "[(2-3)s:a|i:c|_2#2-3]" + "[(3-4)s:b|i:a|_3#3-4]");
         ki.addDoc(fd);
         ki.commit();
 
-        String json = getString(getClass().getResource(
-                "/queries/bugs/optionality_warning.jsonld").getFile());
+        String json = getString(getClass()
+                .getResource("/queries/bugs/optionality_warning.jsonld")
+                .getFile());
         Krill ks = new Krill(json);
 
         Result kr = ks.apply(ki);
@@ -122,8 +123,8 @@
 
         // Old:
         // assertEquals("Optionality of query is ignored", res.at("/warning").asText());
-        assertEquals("Optionality of query is ignored", res.at("/warnings/0/1")
-                .asText());
+        assertEquals("Optionality of query is ignored",
+                res.at("/warnings/0/1").asText());
     };
 
 
@@ -133,9 +134,9 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
         fd.addString("UID", "1");
-        fd.addTV("tokens", "abab", "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]"
-                + "[(1-2)s:b|i:b|_1#1-2]" + "[(2-3)s:a|i:c|_2#2-3]"
-                + "[(3-4)s:b|i:a|_3#3-4]");
+        fd.addTV("tokens", "abab",
+                "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]" + "[(1-2)s:b|i:b|_1#1-2]"
+                        + "[(2-3)s:a|i:c|_2#2-3]" + "[(3-4)s:b|i:a|_3#3-4]");
         ki.addDoc(fd);
         fd = new FieldDocument();
         fd.addString("ID", "doc-2");
@@ -147,8 +148,8 @@
         // Commit!
         ki.commit();
 
-        String json = getString(getClass().getResource(
-                "/queries/bsp-result-check.jsonld").getFile());
+        String json = getString(getClass()
+                .getResource("/queries/bsp-result-check.jsonld").getFile());
         Krill ks = new Krill(json);
         Result kr = ks.apply(ki);
         assertEquals((long) 7, kr.getTotalResults());
@@ -179,19 +180,19 @@
         assertEquals("operation:or", res.at("/query/operation").asText());
 
         assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
-        assertEquals("koral:term", res.at("/query/operands/0/wrap/@type")
-                .asText());
+        assertEquals("koral:term",
+                res.at("/query/operands/0/wrap/@type").asText());
         assertEquals("orth", res.at("/query/operands/0/wrap/layer").asText());
         assertEquals("a", res.at("/query/operands/0/wrap/key").asText());
-        assertEquals("match:eq", res.at("/query/operands/0/wrap/match")
-                .asText());
+        assertEquals("match:eq",
+                res.at("/query/operands/0/wrap/match").asText());
         assertEquals("koral:token", res.at("/query/operands/1/@type").asText());
-        assertEquals("koral:term", res.at("/query/operands/1/wrap/@type")
-                .asText());
+        assertEquals("koral:term",
+                res.at("/query/operands/1/wrap/@type").asText());
         assertEquals("orth", res.at("/query/operands/1/wrap/layer").asText());
         assertEquals("b", res.at("/query/operands/1/wrap/key").asText());
-        assertEquals("match:eq", res.at("/query/operands/1/wrap/match")
-                .asText());
+        assertEquals("match:eq",
+                res.at("/query/operands/1/wrap/match").asText());
 
         // Matches
         assertEquals(1, res.at("/matches/0/UID").asInt());
@@ -212,9 +213,9 @@
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
         fd.addString("UID", "1");
-        fd.addTV("base", "abab", "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]"
-                + "[(1-2)s:b|i:b|_1#1-2]" + "[(2-3)s:a|i:c|_2#2-3]"
-                + "[(3-4)s:b|i:a|_3#3-4]");
+        fd.addTV("base", "abab",
+                "[(0-1)s:a|i:a|_0#0-1|-:t$<i>4]" + "[(1-2)s:b|i:b|_1#1-2]"
+                        + "[(2-3)s:a|i:c|_2#2-3]" + "[(3-4)s:b|i:a|_3#3-4]");
         ki.addDoc(fd);
         fd = new FieldDocument();
         fd.addString("ID", "doc-2");
@@ -236,8 +237,8 @@
         JsonNode res = mapper.readTree(kr.toTokenListJsonString());
 
         assertEquals(3, res.at("/meta/totalResults").asInt());
-        assertEquals("spanNext(base:s:a, base:s:b)", res
-                .at("/meta/serialQuery").asText());
+        assertEquals("spanNext(base:s:a, base:s:b)",
+                res.at("/meta/serialQuery").asText());
         assertEquals(0, res.at("/meta/startIndex").asInt());
         assertEquals(25, res.at("/meta/itemsPerPage").asInt());
 
@@ -264,7 +265,8 @@
     public static String getString (String path) {
         StringBuilder contentBuilder = new StringBuilder();
         try {
-            BufferedReader in = new BufferedReader(new FileReader(URLDecoder.decode(path,"UTF-8")));
+            BufferedReader in = new BufferedReader(
+                    new FileReader(URLDecoder.decode(path, "UTF-8")));
             String str;
             while ((str = in.readLine()) != null) {
                 contentBuilder.append(str);
diff --git a/src/test/java/de/ids_mannheim/korap/server/TestDatabase.java b/src/test/java/de/ids_mannheim/korap/server/TestDatabase.java
index 36dfac2..e4848d9 100644
--- a/src/test/java/de/ids_mannheim/korap/server/TestDatabase.java
+++ b/src/test/java/de/ids_mannheim/korap/server/TestDatabase.java
@@ -29,7 +29,8 @@
         Class.forName("org.sqlite.JDBC");
         conn = DriverManager.getConnection("jdbc:sqlite::memory:");
         this.stat = conn.createStatement();
-        stat.executeUpdate("CREATE TABLE IF NOT EXISTS people (name TEXT, age INTEGER);");
+        stat.executeUpdate(
+                "CREATE TABLE IF NOT EXISTS people (name TEXT, age INTEGER);");
         conn.setAutoCommit(false);
     };
 
@@ -83,7 +84,8 @@
         this.conn = cpds.getConnection();
         conn.setAutoCommit(false);
         this.stat = conn.createStatement();
-        stat.executeUpdate("CREATE TABLE IF NOT EXISTS result_a (text_id INTEGER, match_count INTEGER);");
+        stat.executeUpdate(
+                "CREATE TABLE IF NOT EXISTS result_a (text_id INTEGER, match_count INTEGER);");
         // conn.setAutoCommit(false);
         PreparedStatement prep = this.conn
                 .prepareStatement("INSERT INTO result_a VALUES (?, ?);");
@@ -137,7 +139,8 @@
         conn = cpds.getConnection();
         conn.setAutoCommit(false);
         Statement stat = conn.createStatement();
-        stat.executeUpdate("CREATE TABLE IF NOT EXISTS matchXYZ (text_id INTEGER, match_count INTEGER);");
+        stat.executeUpdate(
+                "CREATE TABLE IF NOT EXISTS matchXYZ (text_id INTEGER, match_count INTEGER);");
         conn.commit();
         stat.close();
 
diff --git a/src/test/java/de/ids_mannheim/korap/server/TestResource.java b/src/test/java/de/ids_mannheim/korap/server/TestResource.java
index 908f3e9..0ef56d6 100644
--- a/src/test/java/de/ids_mannheim/korap/server/TestResource.java
+++ b/src/test/java/de/ids_mannheim/korap/server/TestResource.java
@@ -114,8 +114,8 @@
 
 
 
-            String json = StringfromFile(getClass().getResource(
-                    "/wiki/" + i + ".json").getFile());
+            String json = StringfromFile(
+                    getClass().getResource("/wiki/" + i + ".json").getFile());
 
             Entity jsonE = Entity.json(json);
 
@@ -134,8 +134,8 @@
             }
         };
 
-        String json = StringfromFile(getClass().getResource("/wiki/02439.json")
-                .getFile());
+        String json = StringfromFile(
+                getClass().getResource("/wiki/02439.json").getFile());
         Entity jsonE = Entity.json(json);
 
         try {
@@ -211,18 +211,18 @@
     public void testRemoving () throws IOException {
         String resp;
         JsonNode res;
-
+    
         String json = StringfromFile(getClass().getResource("/wiki/02439.json")
                 .getFile());
         Entity jsonE = Entity.json(json);
-
+    
         try {
             // Put new documents to the index
             resp = target.path("/index/02439").request("application/json")
                     .put(jsonE, String.class);
-
+    
             res = mapper.readTree(resp);
-
+    
             // Check mirroring
             assertEquals(2439, res.at("/text/UID").asInt());
             assertEquals("milena", res.at("/meta/node").asText());
@@ -231,13 +231,13 @@
         catch (Exception e) {
             fail("Server response failed " + e.getMessage() + " (Known issue)");
         };
-
+    
         // Commit!
         resp = target.path("/index").request("application/json")
                 .post(Entity.text(""), String.class);
         res = mapper.readTree(resp);
         assertEquals("milena", res.at("/meta/node").asText());
-
+    
         // Staged data committed
         assertEquals(683, res.at("/messages/0/0").asInt());
     };
@@ -248,8 +248,8 @@
     public void testCollection () throws IOException {
 
         // mate/l:sein
-        String json = getString(getClass().getResource(
-                "/queries/bsp-uid-example.jsonld").getFile());
+        String json = getString(getClass()
+                .getResource("/queries/bsp-uid-example.jsonld").getFile());
 
         try {
             String resp = target.path("/").queryParam("uid", "1")
@@ -259,7 +259,8 @@
             assertEquals(2, res.at("/meta/totalResults").asInt());
         }
         catch (Exception e) {
-            fail("Server response failed: " + e.getMessage() + " (Known issue)");
+            fail("Server response failed: " + e.getMessage()
+                    + " (Known issue)");
         };
 
     };
@@ -268,7 +269,8 @@
     public static String getString (String path) {
         StringBuilder contentBuilder = new StringBuilder();
         try {
-            BufferedReader in = new BufferedReader(new FileReader(URLDecoder.decode(path,"UTF-8")));
+            BufferedReader in = new BufferedReader(
+                    new FileReader(URLDecoder.decode(path, "UTF-8")));
             String str;
             while ((str = in.readLine()) != null) {
                 contentBuilder.append(str);
