diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessor.java b/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessor.java
index c0a88c9..89fe13f 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessor.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessor.java
@@ -28,7 +28,8 @@
  * This class expects the Poliqarp+ ANTLR grammar shipped with Koral
  * v0.3.0.
  * 
- * @author Joachim Bingel (bingel@ids-mannheim.de)
+ * @author Joachim Bingel (bingel@ids-mannheim.de), Eliza Margaretha
+ *         (margaretha@ids-mannheim.de)
  * @version 0.3.0
  * @since 0.1.0
  */
@@ -38,6 +39,7 @@
             .getLogger(PoliqarpPlusQueryProcessor.class);
     private int classCounter = 1;
 
+    boolean isExpansion = false;
     LinkedHashMap<ParseTree, Integer> classWrapRegistry = new LinkedHashMap<ParseTree, Integer>();
 
 
@@ -66,8 +68,8 @@
             processNode(tree);
         }
         else {
-            addError(StatusCodes.MALFORMED_QUERY, "Could not parse query >>> "
-                    + query + " <<<.");
+            addError(StatusCodes.MALFORMED_QUERY,
+                    "Could not parse query >>> " + query + " <<<.");
         }
     }
 
@@ -91,7 +93,7 @@
         // Top-down processing
         if (visited.contains(node))
             return;
-        else
+        else if (!isExpansion)
             visited.add(node);
 
         String nodeCat = getNodeCat(node);
@@ -151,7 +153,7 @@
         }
 
         if (nodeCat.equals("disjunction")) {
-            processDisjunction(node);
+            processDisjunction();
         }
 
         if (nodeCat.equals("position")) {
@@ -234,9 +236,8 @@
      */
     private void processSequence (ParseTree node) {
         // skip in case of emptyTokenSequence or emptyTokenSequenceClass
-        if (node.getChildCount() == 1
-                && getNodeCat(node.getChild(0))
-                        .startsWith("emptyTokenSequence")) {
+        if (node.getChildCount() == 1 && getNodeCat(node.getChild(0))
+                .startsWith("emptyTokenSequence")) {
             return;
         }
         // skip in case this sequence is just a container for an alignment 
@@ -261,6 +262,30 @@
             ArrayList<Object> distances = new ArrayList<Object>();
             distances.add(distance);
             sequence.put("distances", distances);
+
+            // Check optionality
+            ParseTree lastChildNode = node.getChild(node.getChildCount() - 1);
+            if (getNodeCat(lastChildNode).equals("segment")) {
+                ParseTree quantification = getFirstChildWithCat(lastChildNode,
+                        "repetition");
+                if (quantification != null) {
+                    minmax = parseRepetition(quantification);
+                    if (minmax[0] == 0 && minmax[1] == 1) {
+                        visited.add(quantification);
+                        processDisjunction();
+                        // create expansion
+                        isExpansion = true;
+                        LinkedHashMap<String, Object> expansionSequence = KoralObjectGenerator
+                                .makeGroup("sequence");
+                        putIntoSuperObject(expansionSequence);
+                        objectStack.push(expansionSequence);
+                        processNode(node.getChild(0));
+                        processNode(distanceNode.getChild(0));
+                        isExpansion = false;
+                        objectStack.pop();
+                    }
+                }
+            }
             // don't re-visit the emptyTokenSequence node
             visited.add(distanceNode.getChild(0));
         }
@@ -273,6 +298,7 @@
     @SuppressWarnings("unchecked")
     /**
      * empty tokens at beginning/end of sequence
+     * 
      * @param node
      */
     private void processEmptyTokenSequence (ParseTree node) {
@@ -298,8 +324,8 @@
     private void processEmptyTokenSequenceClass (ParseTree node) {
         int classId = 1;
         if (hasChild(node, "spanclass_id")) {
-            classId = Integer.parseInt(node.getChild(1).getChild(0)
-                    .toStringTree(parser));
+            classId = Integer.parseInt(
+                    node.getChild(1).getChild(0).toStringTree(parser));
         }
         LinkedHashMap<String, Object> classGroup = KoralObjectGenerator
                 .makeSpanClass(classId);
@@ -391,7 +417,7 @@
         int i = 1;
         if (node.getChild(0).getText().equals("^")) {
             i = 0; // if there is no first child (anchor is at extreme left or
-                   // right of segment), start counting at 0 in the loop
+                  // right of segment), start counting at 0 in the loop
         }
         // for every alignment anchor, get its left and right child and register
         // these to be wrapped in classes.
@@ -477,7 +503,7 @@
     }
 
 
-    private void processDisjunction (ParseTree node) {
+    private void processDisjunction () {
         LinkedHashMap<String, Object> disjunction = KoralObjectGenerator
                 .makeGroup("disjunction");
         putIntoSuperObject(disjunction);
@@ -633,8 +659,8 @@
         addWarning("You used the 'meta' keyword in a PoliqarpPlus query. This"
                 + " feature is currently not supported. Please use virtual "
                 + "collections to restrict documents by metadata.");
-        CollectionQueryProcessor cq = new CollectionQueryProcessor(node
-                .getChild(1).getText());
+        CollectionQueryProcessor cq = new CollectionQueryProcessor(
+                node.getChild(1).getText());
         requestMap.put("collection", cq.getRequestMap().get("collection"));
         for (ParseTree child : getChildren(node)) {
             visited.add(child);
@@ -777,7 +803,8 @@
 
             // Term is defined recursive with non-necessary brackets
             if (getNodeCat(node.getChild(0)).equals("(")) {
-                return parseTermOrTermGroup(node.getChild(1), negatedGlobal, mode);
+                return parseTermOrTermGroup(node.getChild(1), negatedGlobal,
+                        mode);
             };
 
             String key = null;
@@ -868,7 +895,8 @@
 
             // TermGroup is defined recursive with non-necessary brackets
             if (getNodeCat(node.getChild(0)).equals("(")) {
-                return parseTermOrTermGroup(node.getChild(1), negatedGlobal, mode);
+                return parseTermOrTermGroup(node.getChild(1), negatedGlobal,
+                        mode);
             };
 
             // For termGroups, establish a boolean relation between
@@ -959,8 +987,8 @@
     private Integer[] parseDistance (ParseTree distanceNode) {
         int emptyTokenSeqIndex = getNodeCat(distanceNode).equals("distance") ? 0
                 : 2;
-        Integer[] minmax = parseEmptySegments(distanceNode
-                .getChild(emptyTokenSeqIndex));
+        Integer[] minmax = parseEmptySegments(
+                distanceNode.getChild(emptyTokenSeqIndex));
         Integer min = minmax[0];
         Integer max = minmax[1];
         //        min++;
@@ -1023,8 +1051,8 @@
 
             // Get starting rule from parser
             Method startRule = PoliqarpPlusParser.class.getMethod("request");
-            tree = (ParserRuleContext) startRule
-                    .invoke(parser, (Object[]) null);
+            tree = (ParserRuleContext) startRule.invoke(parser,
+                    (Object[]) null);
         }
         // Some things went wrong ...
         catch (Exception e) {
diff --git a/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java b/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java
index 73f54e1..57ea313 100644
--- a/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java
+++ b/src/test/java/de/ids_mannheim/korap/query/serialize/PoliqarpPlusQueryProcessorTest.java
@@ -41,7 +41,8 @@
 
 
     @Test
-    public void testSingleTokens () throws JsonProcessingException, IOException {
+    public void testSingleTokens ()
+            throws JsonProcessingException, IOException {
         query = "[base=Mann]";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
@@ -86,8 +87,8 @@
 
 
     @Test
-    public void testNegatedTokens () throws JsonProcessingException,
-            IOException {
+    public void testNegatedTokens ()
+            throws JsonProcessingException, IOException {
         query = "![p!=NN]";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
@@ -157,6 +158,7 @@
         assertEquals("match:eq", res.at("/query/wrap/match").asText());
     }
 
+
     @Test
     public void testRegexEscape () throws JsonProcessingException, IOException {
         // Escape regex symbols
@@ -191,8 +193,10 @@
         assertEquals("a\\.\\+\\?\\\\", res.at("/query/wrap/key").asText());
     }
 
+
     @Test
-    public void testRegexWhiteSpace () throws JsonProcessingException, IOException {
+    public void testRegexWhiteSpace ()
+            throws JsonProcessingException, IOException {
         // Escape regex symbols
         query = "\"a b\"";
         qs.setQuery(query, "poliqarpplus");
@@ -231,18 +235,18 @@
 
 
     @Test
-    public void testCaseSensitivityFlag () throws JsonProcessingException,
-            IOException {
+    public void testCaseSensitivityFlag ()
+            throws JsonProcessingException, IOException {
         query = "[orth=deutscher/i]";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:token", res.at("/query/@type").asText());
         assertEquals("koral:term", res.at("/query/wrap/@type").asText());
         assertEquals("deutscher", res.at("/query/wrap/key").asText());
-        assertEquals(true, res.at("/query/wrap/flags:caseInsensitive")
-                .isMissingNode());
-        assertEquals("flags:caseInsensitive", res.at("/query/wrap/flags/0")
-                .asText());
+        assertEquals(true,
+                res.at("/query/wrap/flags:caseInsensitive").isMissingNode());
+        assertEquals("flags:caseInsensitive",
+                res.at("/query/wrap/flags/0").asText());
         assertEquals("orth", res.at("/query/wrap/layer").asText());
         assertEquals("match:eq", res.at("/query/wrap/match").asText());
 
@@ -252,8 +256,8 @@
         assertEquals("koral:token", res.at("/query/@type").asText());
         assertEquals("koral:term", res.at("/query/wrap/@type").asText());
         assertEquals("deutscher", res.at("/query/wrap/key").asText());
-        assertEquals("flags:caseInsensitive", res.at("/query/wrap/flags/0")
-                .asText());
+        assertEquals("flags:caseInsensitive",
+                res.at("/query/wrap/flags/0").asText());
         assertEquals("orth", res.at("/query/wrap/layer").asText());
         assertEquals("match:eq", res.at("/query/wrap/match").asText());
 
@@ -316,7 +320,7 @@
 
         query = "<\".*\">";
         qs.setQuery(query, "poliqarpplus");
-       res = mapper.readTree(qs.toJSON());
+        res = mapper.readTree(qs.toJSON());
         assertEquals("koral:span", res.at("/query/@type").asText());
         assertEquals(".*", res.at("/query/wrap/key").asText());
         assertEquals("type:regex", res.at("/query/wrap/type").asText());
@@ -401,17 +405,14 @@
         assertEquals("true", res.at("/query/inOrder").asText());
         assertEquals("koral:distance", res.at("/query/distances").elements()
                 .next().at("/@type").asText());
-        assertEquals("w",
-                res.at("/query/distances").elements().next().at("/key")
-                        .asText());
+        assertEquals("w", res.at("/query/distances").elements().next()
+                .at("/key").asText());
         assertEquals("koral:boundary", res.at("/query/distances").elements()
                 .next().at("/boundary/@type").asText());
-        assertEquals(1,
-                res.at("/query/distances").elements().next()
-                        .at("/boundary/min").asInt());
-        assertEquals(1,
-                res.at("/query/distances").elements().next()
-                        .at("/boundary/max").asInt());
+        assertEquals(1, res.at("/query/distances").elements().next()
+                .at("/boundary/min").asInt());
+        assertEquals(1, res.at("/query/distances").elements().next()
+                .at("/boundary/max").asInt());
         operands = Lists.newArrayList(res.at("/query/operands").elements());
         assertEquals("koral:token", operands.get(0).at("/@type").asText());
         assertEquals("der", operands.get(0).at("/wrap/key").asText());
@@ -430,17 +431,14 @@
         assertEquals("true", res.at("/query/inOrder").asText());
         assertEquals("koral:distance", res.at("/query/distances").elements()
                 .next().at("/@type").asText());
-        assertEquals("w",
-                res.at("/query/distances").elements().next().at("/key")
-                        .asText());
+        assertEquals("w", res.at("/query/distances").elements().next()
+                .at("/key").asText());
         assertEquals("koral:boundary", res.at("/query/distances").elements()
                 .next().at("/boundary/@type").asText());
-        assertEquals(2,
-                res.at("/query/distances").elements().next()
-                        .at("/boundary/min").asInt());
-        assertEquals(2,
-                res.at("/query/distances").elements().next()
-                        .at("/boundary/max").asInt());
+        assertEquals(2, res.at("/query/distances").elements().next()
+                .at("/boundary/min").asInt());
+        assertEquals(2, res.at("/query/distances").elements().next()
+                .at("/boundary/max").asInt());
         operands = Lists.newArrayList(res.at("/query/operands").elements());
         assertEquals("koral:token", operands.get(0).at("/@type").asText());
         assertEquals("der", operands.get(0).at("/wrap/key").asText());
@@ -459,17 +457,14 @@
         assertEquals("true", res.at("/query/inOrder").asText());
         assertEquals("koral:distance", res.at("/query/distances").elements()
                 .next().at("/@type").asText());
-        assertEquals("w",
-                res.at("/query/distances").elements().next().at("/key")
-                        .asText());
+        assertEquals("w", res.at("/query/distances").elements().next()
+                .at("/key").asText());
         assertEquals("koral:boundary", res.at("/query/distances").elements()
                 .next().at("/boundary/@type").asText());
-        assertEquals(1,
-                res.at("/query/distances").elements().next()
-                        .at("/boundary/min").asInt());
-        assertEquals(2,
-                res.at("/query/distances").elements().next()
-                        .at("/boundary/max").asInt());
+        assertEquals(1, res.at("/query/distances").elements().next()
+                .at("/boundary/min").asInt());
+        assertEquals(2, res.at("/query/distances").elements().next()
+                .at("/boundary/max").asInt());
         operands = Lists.newArrayList(res.at("/query/operands").elements());
         assertEquals("koral:token", operands.get(0).at("/@type").asText());
         assertEquals("der", operands.get(0).at("/wrap/key").asText());
@@ -488,17 +483,14 @@
         assertEquals("true", res.at("/query/inOrder").asText());
         assertEquals("koral:distance", res.at("/query/distances").elements()
                 .next().at("/@type").asText());
-        assertEquals("w",
-                res.at("/query/distances").elements().next().at("/key")
-                        .asText());
+        assertEquals("w", res.at("/query/distances").elements().next()
+                .at("/key").asText());
         assertEquals("koral:boundary", res.at("/query/distances").elements()
                 .next().at("/boundary/@type").asText());
-        assertEquals(1,
-                res.at("/query/distances").elements().next()
-                        .at("/boundary/min").asInt());
-        assertEquals(true,
-                res.at("/query/distances").elements().next()
-                        .at("/boundary/max").isMissingNode());
+        assertEquals(1, res.at("/query/distances").elements().next()
+                .at("/boundary/min").asInt());
+        assertEquals(true, res.at("/query/distances").elements().next()
+                .at("/boundary/max").isMissingNode());
         operands = Lists.newArrayList(res.at("/query/operands").elements());
         assertEquals("koral:token", operands.get(0).at("/@type").asText());
         assertEquals("der", operands.get(0).at("/wrap/key").asText());
@@ -517,17 +509,14 @@
         assertEquals("true", res.at("/query/inOrder").asText());
         assertEquals("koral:distance", res.at("/query/distances").elements()
                 .next().at("/@type").asText());
-        assertEquals("w",
-                res.at("/query/distances").elements().next().at("/key")
-                        .asText());
+        assertEquals("w", res.at("/query/distances").elements().next()
+                .at("/key").asText());
         assertEquals("koral:boundary", res.at("/query/distances").elements()
                 .next().at("/boundary/@type").asText());
-        assertEquals(0,
-                res.at("/query/distances").elements().next()
-                        .at("/boundary/min").asInt());
-        assertEquals(true,
-                res.at("/query/distances").elements().next()
-                        .at("/boundary/max").isMissingNode());
+        assertEquals(0, res.at("/query/distances").elements().next()
+                .at("/boundary/min").asInt());
+        assertEquals(true, res.at("/query/distances").elements().next()
+                .at("/boundary/max").isMissingNode());
 
         query = "[base=der][]{2,5}[base=Mann][]?[][base=Frau]";
         qs.setQuery(query, "poliqarpplus");
@@ -537,41 +526,34 @@
         assertEquals("true", res.at("/query/inOrder").asText());
         assertEquals("koral:distance", res.at("/query/distances").elements()
                 .next().at("/@type").asText());
-        assertEquals("w",
-                res.at("/query/distances").elements().next().at("/key")
-                        .asText());
+        assertEquals("w", res.at("/query/distances").elements().next()
+                .at("/key").asText());
         assertEquals("koral:boundary", res.at("/query/distances").elements()
                 .next().at("/boundary/@type").asText());
-        assertEquals(2,
-                res.at("/query/distances").elements().next()
-                        .at("/boundary/min").asInt());
-        assertEquals(5,
-                res.at("/query/distances").elements().next()
-                        .at("/boundary/max").asInt());
+        assertEquals(2, res.at("/query/distances").elements().next()
+                .at("/boundary/min").asInt());
+        assertEquals(5, res.at("/query/distances").elements().next()
+                .at("/boundary/max").asInt());
         operands = Lists.newArrayList(res.at("/query/operands").elements());
         assertEquals("koral:token", operands.get(0).at("/@type").asText());
         assertEquals("der", operands.get(0).at("/wrap/key").asText());
         assertEquals("lemma", operands.get(0).at("/wrap/layer").asText());
         assertEquals("match:eq", operands.get(0).at("/wrap/match").asText());
         assertEquals("koral:group", operands.get(1).at("/@type").asText());
-        assertEquals("operation:sequence", operands.get(1).at("/operation")
-                .asText());
+        assertEquals("operation:sequence",
+                operands.get(1).at("/operation").asText());
         assertEquals("koral:distance", operands.get(1).get("distances")
                 .elements().next().at("/@type").asText());
         assertEquals("w", operands.get(1).get("distances").elements().next()
                 .at("/key").asText());
         assertEquals("koral:boundary", operands.get(1).get("distances")
                 .elements().next().at("/boundary/@type").asText());
-        assertEquals(
-                1,
-                operands.get(1).get("distances").elements().next()
-                        .at("/boundary/min").asInt());
-        assertEquals(
-                2,
-                operands.get(1).get("distances").elements().next()
-                        .at("/boundary/max").asInt());
-        operands = Lists.newArrayList(operands.get(1).get("operands")
-                .elements());
+        assertEquals(1, operands.get(1).get("distances").elements().next()
+                .at("/boundary/min").asInt());
+        assertEquals(2, operands.get(1).get("distances").elements().next()
+                .at("/boundary/max").asInt());
+        operands = Lists
+                .newArrayList(operands.get(1).get("operands").elements());
         assertEquals("Mann", operands.get(0).at("/wrap/key").asText());
         assertEquals("lemma", operands.get(0).at("/wrap/layer").asText());
         assertEquals("match:eq", operands.get(0).at("/wrap/match").asText());
@@ -592,34 +574,32 @@
         assertEquals("lemma", operands.get(0).at("/wrap/layer").asText());
         assertEquals("match:eq", operands.get(0).at("/wrap/match").asText());
         assertEquals("koral:group", operands.get(1).at("/@type").asText());
-        assertEquals("operation:sequence", operands.get(1).at("/operation")
-                .asText());
+        assertEquals("operation:sequence",
+                operands.get(1).at("/operation").asText());
         assertEquals("koral:distance", operands.get(1).get("distances")
                 .elements().next().at("/@type").asText());
         assertEquals("w", operands.get(1).get("distances").elements().next()
                 .at("/key").asText());
         assertEquals("koral:boundary", operands.get(1).get("distances")
                 .elements().next().at("/boundary/@type").asText());
-        assertEquals(
-                0,
-                operands.get(1).get("distances").elements().next()
-                        .at("/boundary/min").asInt());
+        assertEquals(0, operands.get(1).get("distances").elements().next()
+                .at("/boundary/min").asInt());
         assertEquals(true, operands.get(1).get("distances").elements().next()
                 .at("/boundary/max").isMissingNode());
-        operands = Lists.newArrayList(operands.get(1).get("operands")
-                .elements());
+        operands = Lists
+                .newArrayList(operands.get(1).get("operands").elements());
         assertEquals("der", operands.get(0).at("/wrap/key").asText());
         assertEquals("lemma", operands.get(0).at("/wrap/layer").asText());
         assertEquals("match:eq", operands.get(0).at("/wrap/match").asText());
         assertEquals("koral:group", operands.get(1).at("/@type").asText());
-        assertEquals("operation:position", operands.get(1).at("/operation")
-                .asText());
+        assertEquals("operation:position",
+                operands.get(1).at("/operation").asText());
     }
 
 
     @Test
-    public void testDistancesWithClass () throws JsonProcessingException,
-            IOException {
+    public void testDistancesWithClass ()
+            throws JsonProcessingException, IOException {
         query = "[base=der]{[]}[base=Mann]";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
@@ -631,11 +611,11 @@
         assertEquals("der", operands.get(0).at("/wrap/key").asText());
         assertEquals("Mann", operands.get(2).at("/wrap/key").asText());
         assertEquals("koral:group", operands.get(1).at("/@type").asText());
-        assertEquals("operation:class", operands.get(1).at("/operation")
-                .asText());
+        assertEquals("operation:class",
+                operands.get(1).at("/operation").asText());
         assertEquals(1, operands.get(1).at("/classOut").asInt());
-        operands = Lists.newArrayList(operands.get(1).at("/operands")
-                .elements());
+        operands = Lists
+                .newArrayList(operands.get(1).at("/operands").elements());
         assertEquals("koral:token", operands.get(0).at("/@type").asText());
         assertEquals(true, operands.get(0).at("/wrap").isMissingNode());
         assertEquals(1, res.at("/meta/highlight/0").asInt());
@@ -644,8 +624,8 @@
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         operands = Lists.newArrayList(res.at("/query/operands").elements());
-        assertEquals("operation:class", operands.get(1).at("/operation")
-                .asText());
+        assertEquals("operation:class",
+                operands.get(1).at("/operation").asText());
         assertEquals(2, operands.get(1).at("/classOut").asInt());
         assertEquals(2, res.at("/meta/highlight/0").asInt());
 
@@ -653,8 +633,8 @@
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         operands = Lists.newArrayList(res.at("/query/operands").elements());
-        assertEquals("operation:class", operands.get(1).at("/operation")
-                .asText());
+        assertEquals("operation:class",
+                operands.get(1).at("/operation").asText());
         assertEquals(3, operands.get(1).at("/classOut").asInt());
         assertEquals(3, res.at("/meta/highlight/0").asInt());
         assertEquals("operation:class",
@@ -668,8 +648,8 @@
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         operands = Lists.newArrayList(res.at("/query/operands").elements());
-        assertEquals("operation:class", operands.get(0).at("/operation")
-                .asText());
+        assertEquals("operation:class",
+                operands.get(0).at("/operation").asText());
         assertEquals(1, operands.get(0).at("/classOut").asInt());
         assertEquals(1, res.at("/meta/highlight/0").asInt());
 
@@ -678,8 +658,8 @@
         res = mapper.readTree(qs.toJSON());
         operands = Lists.newArrayList(res.at("/query/operands").elements());
         assertEquals(1, operands.size());  // class operation may only have one operand (the sequence)
-        operands = Lists.newArrayList(operands.get(0).at("/operands")
-                .elements());
+        operands = Lists
+                .newArrayList(operands.get(0).at("/operands").elements());
         assertEquals(3, operands.size());  // the sequence has three operands ("der", "[]" and "Mann")
         assertEquals(1, res.at("/meta/highlight/0").asInt());
         assertEquals(2, res.at("/meta/highlight/1").asInt());
@@ -694,7 +674,7 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:token", res.at("/query/@type").asText());
         assertEquals(true, res.at("/query/key").isMissingNode());
-        
+
         query = "contains(<s>, [])";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
@@ -714,98 +694,82 @@
         assertEquals("koral:group", res.at("/query/operands/1/@type").asText());
         assertEquals("operation:repetition",
                 res.at("/query/operands/1/operation").asText());
-        assertEquals("koral:token", res
-                .at("/query/operands/1/operands/0/@type").asText());
-        assertEquals(true, res.at("/query/operands/1/operands/0/key")
-                .isMissingNode());
+        assertEquals("koral:token",
+                res.at("/query/operands/1/operands/0/@type").asText());
+        assertEquals(true,
+                res.at("/query/operands/1/operands/0/key").isMissingNode());
 
         query = "contains(<s>, {1:[]{3}})";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals("s", res.at("/query/operands/0/wrap/key").asText());
         assertEquals("koral:group", res.at("/query/operands/1/@type").asText());
-        assertEquals("operation:class", res.at("/query/operands/1/operation")
-                .asText());
+        assertEquals("operation:class",
+                res.at("/query/operands/1/operation").asText());
         assertEquals("operation:repetition",
                 res.at("/query/operands/1/operands/0/operation").asText());
-        assertEquals("koral:token",
-                res.at("/query/operands/1/operands/0/operands/0/@type")
-                        .asText());
-        assertEquals(true, res
-                .at("/query/operands/1/operands/0/operands/0/key")
+        assertEquals("koral:token", res
+                .at("/query/operands/1/operands/0/operands/0/@type").asText());
+        assertEquals(true, res.at("/query/operands/1/operands/0/operands/0/key")
                 .isMissingNode());
 
     }
 
 
     @Test
-    public void testEmptyTokenSequence () throws JsonProcessingException, IOException {
+    public void testEmptyTokenSequence ()
+            throws JsonProcessingException, IOException {
         query = "[]{3}";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
 
-        assertEquals("koral:group",
-                     res.at("/query/@type").asText());
+        assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:repetition",
-                     res.at("/query/operation").asText());
-        assertEquals("koral:token",
-                     res.at("/query/operands/0/@type").asText());
+                res.at("/query/operation").asText());
+        assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
         assertEquals("koral:boundary",
-                     res.at("/query/boundary/@type").asText());
-        assertEquals(3,
-                     res.at("/query/boundary/min").asInt());
-        assertEquals(3,
-                     res.at("/query/boundary/max").asInt());
+                res.at("/query/boundary/@type").asText());
+        assertEquals(3, res.at("/query/boundary/min").asInt());
+        assertEquals(3, res.at("/query/boundary/max").asInt());
 
         query = "[]{1,3}";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
 
-        assertEquals("koral:group",
-                     res.at("/query/@type").asText());
+        assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:repetition",
-                     res.at("/query/operation").asText());
-        assertEquals("koral:token",
-                     res.at("/query/operands/0/@type").asText());
+                res.at("/query/operation").asText());
+        assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
         assertEquals("koral:boundary",
-                     res.at("/query/boundary/@type").asText());
-        assertEquals(1,
-                     res.at("/query/boundary/min").asInt());
-        assertEquals(3,
-                     res.at("/query/boundary/max").asInt());
+                res.at("/query/boundary/@type").asText());
+        assertEquals(1, res.at("/query/boundary/min").asInt());
+        assertEquals(3, res.at("/query/boundary/max").asInt());
 
 
         query = "[]{ , 3}";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
 
-        assertEquals("koral:group",
-                     res.at("/query/@type").asText());
+        assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:repetition",
-                     res.at("/query/operation").asText());
-        assertEquals("koral:token",
-                     res.at("/query/operands/0/@type").asText());
+                res.at("/query/operation").asText());
+        assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
         assertEquals("koral:boundary",
-                     res.at("/query/boundary/@type").asText());
-        assertEquals(0,
-                     res.at("/query/boundary/min").asInt());
-        assertEquals(3,
-                     res.at("/query/boundary/max").asInt());
+                res.at("/query/boundary/@type").asText());
+        assertEquals(0, res.at("/query/boundary/min").asInt());
+        assertEquals(3, res.at("/query/boundary/max").asInt());
 
         query = "[]{4,}";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
 
-        assertEquals("koral:group",
-                     res.at("/query/@type").asText());
+        assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:repetition",
-                     res.at("/query/operation").asText());
-        assertEquals("koral:token",
-                     res.at("/query/operands/0/@type").asText());
+                res.at("/query/operation").asText());
+        assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
         assertEquals("koral:boundary",
-                     res.at("/query/boundary/@type").asText());
-        assertEquals(4,
-                     res.at("/query/boundary/min").asInt());
+                res.at("/query/boundary/@type").asText());
+        assertEquals(4, res.at("/query/boundary/min").asInt());
         assertTrue(res.at("/query/boundary/max").isMissingNode());
     }
 
@@ -825,12 +789,12 @@
         res = mapper.readTree(qs.toJSON());
         operands = Lists.newArrayList(res.at("/query/operands").elements());
         assertEquals("koral:group", operands.get(0).at("/@type").asText());
-        assertEquals("operation:repetition", operands.get(0).at("/operation")
-                .asText());
+        assertEquals("operation:repetition",
+                operands.get(0).at("/operation").asText());
         assertEquals(2, operands.get(0).at("/boundary/min").asInt());
         assertEquals(2, operands.get(0).at("/boundary/max").asInt());
-        operands = Lists.newArrayList(operands.get(0).at("/operands")
-                .elements());
+        operands = Lists
+                .newArrayList(operands.get(0).at("/operands").elements());
         assertEquals("koral:token", operands.get(0).at("/@type").asText());
         assertEquals(true, operands.get(0).at("/key").isMissingNode());
 
@@ -860,34 +824,61 @@
         assertEquals("koral:token", operands.get(0).at("/@type").asText());
         assertEquals(true, operands.get(0).at("/key").isMissingNode());
     }
-    
+
+
     @Test
-    public void testDistanceWithEmptyTokenAndOptionality() throws JsonProcessingException, IOException{
-    	query = "[base=der][][base=Mann]?";
-    	qs.setQuery(query, "poliqarpplus");
-        res = mapper.readTree(qs.toJSON());
+    public void testDistanceWithEmptyTokenAndOptionality ()
+            throws JsonProcessingException, IOException {
+        query = "[base=der][][base=Mann]?";
+        qs.setQuery(query, "poliqarpplus");
+        String koralQuery = qs.toJSON();
+        res = mapper.readTree(koralQuery);
+
+        assertEquals("koral:group", res.at("/query/@type").asText());
+        assertEquals("operation:disjunction", res.at("/query/operation").asText());
         
-        String path = "/query";
-        String serializedQuery = mapper.writeValueAsString(res.at(path));
-        //System.out.println(serializedQuery);
+        String disjunctionOperand1 = "/query/operands/0/";
+        assertEquals("operation:sequence", res.at(disjunctionOperand1+"operation").asText());
+        assertEquals("der", res.at(disjunctionOperand1+"operands/0/wrap/key").asText());
+        assertEquals("koral:token", res.at(disjunctionOperand1+"operands/1/@type").asText());
         
-//        {"@type":"koral:group",
-//        	"operation":"operation:sequence",
-//        	"operands":[
-//        		{"@type":"koral:token",
-//        			"wrap":{"@type":"koral:term","key":"der","layer":"lemma","match":"match:eq"}},
-//        		{"@type":"koral:group",
-//        				"operation":"operation:repetition",
-//        				"operands":[{
-//        					"@type":"koral:token","wrap":{"@type":"koral:term","key":"Mann","layer":"lemma","match":"match:eq"}}],
-//        				"boundary":{"@type":"koral:boundary","min":0,"max":1}}
-//        	],
-//        	"inOrder":true,
-//        	"distances":[
-//	             {"@type":"koral:distance",
-//	            	 "key":"w",
-//	            	 "boundary":{
-//	            	 	"@type":"koral:boundary","min":1,"max":1},"min":1,"max":1}]}
+        String disjunctionOperand2 = "/query/operands/1/";
+        assertEquals("operation:sequence", res.at(disjunctionOperand2+"operation").asText());
+        assertEquals("der", res.at(disjunctionOperand2+"operands/0/wrap/key").asText());
+        assertEquals("Mann", res.at(disjunctionOperand2+"operands/1/wrap/key").asText());
+        assertEquals("1", res.at(disjunctionOperand2+"distances/0/boundary/min").asText());
+        assertEquals("1", res.at(disjunctionOperand2+"distances/0/boundary/max").asText());
+        
+    }
+
+    @Test
+    public void testDistanceWithEmptyTokenAndOptionality2 ()
+            throws JsonProcessingException, IOException {
+        query = "[base=der][base=bose][][base=Mann]?";
+        qs.setQuery(query, "poliqarpplus");
+        String koralQuery = qs.toJSON();
+        res = mapper.readTree(koralQuery);
+
+        assertEquals("koral:group", res.at("/query/@type").asText());
+        assertEquals("operation:sequence", res.at("/query/operation").asText());
+        
+        assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
+        assertEquals("der", res.at("/query/operands/0/wrap/key").asText());
+        
+        assertEquals("koral:group", res.at("/query/operands/1/@type").asText());
+        assertEquals("operation:disjunction", res.at("/query/operands/1/operation").asText());
+        
+        String disjunctionOperand1 = "/query/operands/1/operands/0/";
+        assertEquals("operation:sequence", res.at(disjunctionOperand1+"operation").asText());
+        assertEquals("bose", res.at(disjunctionOperand1+"operands/0/wrap/key").asText());
+        assertEquals("koral:token", res.at(disjunctionOperand1+"operands/1/@type").asText());
+        
+        String disjunctionOperand2 = "/query/operands/1/operands/1/";
+        assertEquals("operation:sequence", res.at(disjunctionOperand2+"operation").asText());
+        assertEquals("bose", res.at(disjunctionOperand2+"operands/0/wrap/key").asText());
+        assertEquals("Mann", res.at(disjunctionOperand2+"operands/1/wrap/key").asText());
+        assertEquals("1", res.at(disjunctionOperand2+"distances/0/boundary/min").asText());
+        assertEquals("1", res.at(disjunctionOperand2+"distances/0/boundary/max").asText());
     }
 
     @Test
@@ -896,8 +887,8 @@
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:group", res.at("/query/@type").asText());
-        assertEquals("operation:repetition", res.at("/query/operation")
-                .asText());
+        assertEquals("operation:repetition",
+                res.at("/query/operation").asText());
         assertEquals("der", res.at("/query/operands/0/wrap/key").asText());
         assertEquals(3, res.at("/query/boundary/min").asInt());
         assertEquals(3, res.at("/query/boundary/max").asInt());
@@ -935,8 +926,8 @@
 
 
     @Test
-    public void testGroupRepetition () throws JsonProcessingException,
-            IOException {
+    public void testGroupRepetition ()
+            throws JsonProcessingException, IOException {
         query = "contains(<s>, (der){3})";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
@@ -952,8 +943,8 @@
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals(3, res.at("/query/operands/1/boundary/min").asInt());
-        assertEquals(true, res.at("/query/operands/1/boundary/max")
-                .isMissingNode());
+        assertEquals(true,
+                res.at("/query/operands/1/boundary/max").isMissingNode());
 
         query = "contains(<s>, (der){,3})";
         qs.setQuery(query, "poliqarpplus");
@@ -971,8 +962,8 @@
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals(0, res.at("/query/operands/1/boundary/min").asInt());
-        assertEquals(true, res.at("/query/operands/1/boundary/max")
-                .isMissingNode());
+        assertEquals(true,
+                res.at("/query/operands/1/boundary/max").isMissingNode());
     };
 
 
@@ -1003,12 +994,12 @@
         assertEquals("frames:isAround", res.at("/query/frames/0").asText());
         assertEquals("s", res.at("/query/operands/0/wrap/key").asText());
         assertEquals("koral:group", res.at("/query/operands/1/@type").asText());
-        assertEquals("operation:sequence", res
-                .at("/query/operands/1/operation").asText());
-        assertEquals("der", res.at("/query/operands/1/operands/0/wrap/key")
-                .asText());
-        assertEquals("Mann", res.at("/query/operands/1/operands/1/wrap/key")
-                .asText());
+        assertEquals("operation:sequence",
+                res.at("/query/operands/1/operation").asText());
+        assertEquals("der",
+                res.at("/query/operands/1/operands/0/wrap/key").asText());
+        assertEquals("Mann",
+                res.at("/query/operands/1/operands/1/wrap/key").asText());
 
         query = "contains(<s>,[orth=der][orth=Mann]*)";
         qs.setQuery(query, "poliqarpplus");
@@ -1018,14 +1009,14 @@
         assertEquals("frames:isAround", res.at("/query/frames/0").asText());
         assertEquals("s", res.at("/query/operands/0/wrap/key").asText());
         assertEquals("koral:group", res.at("/query/operands/1/@type").asText());
-        assertEquals("operation:sequence", res
-                .at("/query/operands/1/operation").asText());
-        assertEquals("der", res.at("/query/operands/1/operands/0/wrap/key")
-                .asText());
+        assertEquals("operation:sequence",
+                res.at("/query/operands/1/operation").asText());
+        assertEquals("der",
+                res.at("/query/operands/1/operands/0/wrap/key").asText());
         assertEquals("operation:repetition",
                 res.at("/query/operands/1/operands/1/operation").asText());
-        assertEquals(0, res.at("/query/operands/1/operands/1/boundary/min")
-                .asInt());
+        assertEquals(0,
+                res.at("/query/operands/1/operands/1/boundary/min").asInt());
         assertEquals(true, res.at("/query/operands/1/operands/1/boundary/max")
                 .isMissingNode());
         assertEquals("Mann",
@@ -1037,14 +1028,14 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("s", res.at("/query/operands/0/wrap/key").asText());
         assertEquals("koral:group", res.at("/query/operands/1/@type").asText());
-        assertEquals("frames:startsWith", res.at("/query/operands/1/frames/0")
-                .asText());
-        assertEquals("operation:position", res
-                .at("/query/operands/1/operation").asText());
-        assertEquals("np", res.at("/query/operands/1/operands/0/wrap/key")
-                .asText());
-        assertEquals("pp", res.at("/query/operands/1/operands/1/wrap/key")
-                .asText());
+        assertEquals("frames:startsWith",
+                res.at("/query/operands/1/frames/0").asText());
+        assertEquals("operation:position",
+                res.at("/query/operands/1/operation").asText());
+        assertEquals("np",
+                res.at("/query/operands/1/operands/0/wrap/key").asText());
+        assertEquals("pp",
+                res.at("/query/operands/1/operands/1/wrap/key").asText());
 
         query = "[base=Auto]overlaps(<s>, der)";
         qs.setQuery(query, "poliqarpplus");
@@ -1052,18 +1043,18 @@
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:sequence", res.at("/query/operation").asText());
         assertEquals("koral:group", res.at("/query/operands/1/@type").asText());
-        assertEquals("operation:position", res
-                .at("/query/operands/1/operation").asText());
-        assertEquals("frames:overlapsLeft", res
-                .at("/query/operands/1/frames/0").asText());
+        assertEquals("operation:position",
+                res.at("/query/operands/1/operation").asText());
+        assertEquals("frames:overlapsLeft",
+                res.at("/query/operands/1/frames/0").asText());
         assertEquals("frames:overlapsRight",
                 res.at("/query/operands/1/frames/1").asText());
-        assertEquals("koral:span", res.at("/query/operands/1/operands/0/@type")
-                .asText());
-        assertEquals("s", res.at("/query/operands/1/operands/0/wrap/key")
-                .asText());
-        assertEquals("koral:token", res
-                .at("/query/operands/1/operands/1/@type").asText());
+        assertEquals("koral:span",
+                res.at("/query/operands/1/operands/0/@type").asText());
+        assertEquals("s",
+                res.at("/query/operands/1/operands/0/wrap/key").asText());
+        assertEquals("koral:token",
+                res.at("/query/operands/1/operands/1/@type").asText());
 
         query = "[base=Auto]            overlaps(<s>, der)";
         qs.setQuery(query, "poliqarpplus");
@@ -1071,24 +1062,24 @@
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:sequence", res.at("/query/operation").asText());
         assertEquals("koral:group", res.at("/query/operands/1/@type").asText());
-        assertEquals("operation:position", res
-                .at("/query/operands/1/operation").asText());
-        assertEquals("frames:overlapsLeft", res
-                .at("/query/operands/1/frames/0").asText());
+        assertEquals("operation:position",
+                res.at("/query/operands/1/operation").asText());
+        assertEquals("frames:overlapsLeft",
+                res.at("/query/operands/1/frames/0").asText());
         assertEquals("frames:overlapsRight",
                 res.at("/query/operands/1/frames/1").asText());
-        assertEquals("koral:span", res.at("/query/operands/1/operands/0/@type")
-                .asText());
-        assertEquals("s", res.at("/query/operands/1/operands/0/wrap/key")
-                .asText());
-        assertEquals("koral:token", res
-                .at("/query/operands/1/operands/1/@type").asText());
+        assertEquals("koral:span",
+                res.at("/query/operands/1/operands/0/@type").asText());
+        assertEquals("s",
+                res.at("/query/operands/1/operands/0/wrap/key").asText());
+        assertEquals("koral:token",
+                res.at("/query/operands/1/operands/1/@type").asText());
     };
 
 
     @Test
-    public void testCoordinatedFields () throws JsonProcessingException,
-            IOException {
+    public void testCoordinatedFields ()
+            throws JsonProcessingException, IOException {
         query = "[base=Mann&(cas=N|cas=A)]";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
@@ -1096,18 +1087,18 @@
         assertEquals("relation:and", res.at("/query/wrap/relation").asText());
         assertEquals("Mann", res.at("/query/wrap/operands/0/key").asText());
         assertEquals("lemma", res.at("/query/wrap/operands/0/layer").asText());
-        assertEquals("koral:termGroup", res.at("/query/wrap/operands/1/@type")
-                .asText());
-        assertEquals("relation:or", res.at("/query/wrap/operands/1/relation")
-                .asText());
-        assertEquals("N", res.at("/query/wrap/operands/1/operands/0/key")
-                .asText());
-        assertEquals("cas", res.at("/query/wrap/operands/1/operands/0/layer")
-                .asText());
-        assertEquals("A", res.at("/query/wrap/operands/1/operands/1/key")
-                .asText());
-        assertEquals("cas", res.at("/query/wrap/operands/1/operands/1/layer")
-                .asText());
+        assertEquals("koral:termGroup",
+                res.at("/query/wrap/operands/1/@type").asText());
+        assertEquals("relation:or",
+                res.at("/query/wrap/operands/1/relation").asText());
+        assertEquals("N",
+                res.at("/query/wrap/operands/1/operands/0/key").asText());
+        assertEquals("cas",
+                res.at("/query/wrap/operands/1/operands/0/layer").asText());
+        assertEquals("A",
+                res.at("/query/wrap/operands/1/operands/1/key").asText());
+        assertEquals("cas",
+                res.at("/query/wrap/operands/1/operands/1/layer").asText());
 
         query = "[base=Mann&cas=N&gen=m]";
         qs.setQuery(query, "poliqarpplus");
@@ -1116,23 +1107,24 @@
         assertEquals("relation:and", res.at("/query/wrap/relation").asText());
         assertEquals("Mann", res.at("/query/wrap/operands/0/key").asText());
         assertEquals("lemma", res.at("/query/wrap/operands/0/layer").asText());
-        assertEquals("koral:termGroup", res.at("/query/wrap/operands/1/@type")
-                .asText());
-        assertEquals("relation:and", res.at("/query/wrap/operands/1/relation")
-                .asText());
-        assertEquals("N", res.at("/query/wrap/operands/1/operands/0/key")
-                .asText());
-        assertEquals("cas", res.at("/query/wrap/operands/1/operands/0/layer")
-                .asText());
-        assertEquals("m", res.at("/query/wrap/operands/1/operands/1/key")
-                .asText());
-        assertEquals("gen", res.at("/query/wrap/operands/1/operands/1/layer")
-                .asText());
+        assertEquals("koral:termGroup",
+                res.at("/query/wrap/operands/1/@type").asText());
+        assertEquals("relation:and",
+                res.at("/query/wrap/operands/1/relation").asText());
+        assertEquals("N",
+                res.at("/query/wrap/operands/1/operands/0/key").asText());
+        assertEquals("cas",
+                res.at("/query/wrap/operands/1/operands/0/layer").asText());
+        assertEquals("m",
+                res.at("/query/wrap/operands/1/operands/1/key").asText());
+        assertEquals("gen",
+                res.at("/query/wrap/operands/1/operands/1/layer").asText());
     }
 
+
     @Test
-    public void testUnnecessaryParentheses () throws JsonProcessingException,
-            IOException {
+    public void testUnnecessaryParentheses ()
+            throws JsonProcessingException, IOException {
         query = "[(base=Mann)]";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
@@ -1153,60 +1145,43 @@
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:token", res.at("/query/@type").asText());
-        assertEquals("koral:termGroup", res.at("/query/wrap/@type")
-                .asText());
-        assertEquals("relation:and", res.at("/query/wrap/relation")
-                     .asText());
-        assertEquals("Mann", res.at("/query/wrap/operands/0/key")
-                     .asText());
-        assertEquals("lemma", res.at("/query/wrap/operands/0/layer")
-                     .asText());
-        assertEquals("N", res.at("/query/wrap/operands/1/key")
-                     .asText());
-        assertEquals("cas", res.at("/query/wrap/operands/1/layer")
-                     .asText());
+        assertEquals("koral:termGroup", res.at("/query/wrap/@type").asText());
+        assertEquals("relation:and", res.at("/query/wrap/relation").asText());
+        assertEquals("Mann", res.at("/query/wrap/operands/0/key").asText());
+        assertEquals("lemma", res.at("/query/wrap/operands/0/layer").asText());
+        assertEquals("N", res.at("/query/wrap/operands/1/key").asText());
+        assertEquals("cas", res.at("/query/wrap/operands/1/layer").asText());
 
 
         query = "[(((base=Mann&cas=N)))]";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:token", res.at("/query/@type").asText());
-        assertEquals("koral:termGroup", res.at("/query/wrap/@type")
-                .asText());
-        assertEquals("relation:and", res.at("/query/wrap/relation")
-                     .asText());
-        assertEquals("Mann", res.at("/query/wrap/operands/0/key")
-                     .asText());
-        assertEquals("lemma", res.at("/query/wrap/operands/0/layer")
-                     .asText());
-        assertEquals("N", res.at("/query/wrap/operands/1/key")
-                     .asText());
-        assertEquals("cas", res.at("/query/wrap/operands/1/layer")
-                     .asText());
+        assertEquals("koral:termGroup", res.at("/query/wrap/@type").asText());
+        assertEquals("relation:and", res.at("/query/wrap/relation").asText());
+        assertEquals("Mann", res.at("/query/wrap/operands/0/key").asText());
+        assertEquals("lemma", res.at("/query/wrap/operands/0/layer").asText());
+        assertEquals("N", res.at("/query/wrap/operands/1/key").asText());
+        assertEquals("cas", res.at("/query/wrap/operands/1/layer").asText());
 
 
         query = "[(((base=Mann&((cas=N)))))]";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:token", res.at("/query/@type").asText());
-        assertEquals("koral:termGroup", res.at("/query/wrap/@type")
-                .asText());
-        assertEquals("relation:and", res.at("/query/wrap/relation")
-                     .asText());
-        assertEquals("Mann", res.at("/query/wrap/operands/0/key")
-                     .asText());
-        assertEquals("lemma", res.at("/query/wrap/operands/0/layer")
-                     .asText());
-        assertEquals("N", res.at("/query/wrap/operands/1/key")
-                     .asText());
-        assertEquals("cas", res.at("/query/wrap/operands/1/layer")
-                     .asText());
+        assertEquals("koral:termGroup", res.at("/query/wrap/@type").asText());
+        assertEquals("relation:and", res.at("/query/wrap/relation").asText());
+        assertEquals("Mann", res.at("/query/wrap/operands/0/key").asText());
+        assertEquals("lemma", res.at("/query/wrap/operands/0/layer").asText());
+        assertEquals("N", res.at("/query/wrap/operands/1/key").asText());
+        assertEquals("cas", res.at("/query/wrap/operands/1/layer").asText());
 
     };
 
+
     @Test
-    public void testTokenSequence () throws JsonProcessingException,
-            IOException {
+    public void testTokenSequence ()
+            throws JsonProcessingException, IOException {
         query = "[base=Mann][orth=Frau]";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
@@ -1232,13 +1207,14 @@
 
 
     @Test
-    public void testDisjSegments () throws JsonProcessingException, IOException {
+    public void testDisjSegments ()
+            throws JsonProcessingException, IOException {
         query = "[base=der]|[base=das]";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:group", res.at("/query/@type").asText());
-        assertEquals("operation:disjunction", res.at("/query/operation")
-                .asText());
+        assertEquals("operation:disjunction",
+                res.at("/query/operation").asText());
         assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
         assertEquals("koral:token", res.at("/query/operands/1/@type").asText());
         assertEquals("der", res.at("/query/operands/0/wrap/key").asText());
@@ -1268,41 +1244,41 @@
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:group", res.at("/query/@type").asText());
-        assertEquals("operation:disjunction", res.at("/query/operation")
-                .asText());
+        assertEquals("operation:disjunction",
+                res.at("/query/operation").asText());
         assertEquals("koral:group", res.at("/query/operands/0/@type").asText());
-        assertEquals("operation:sequence", res
-                .at("/query/operands/0/operation").asText());
-        assertEquals("koral:token", res
-                .at("/query/operands/0/operands/0/@type").asText());
-        assertEquals("der", res.at("/query/operands/0/operands/0/wrap/key")
-                .asText());
-        assertEquals("katze", res.at("/query/operands/0/operands/1/wrap/key")
-                .asText());
-        assertEquals("eine", res.at("/query/operands/1/operands/0/wrap/key")
-                .asText());
-        assertEquals("baum", res.at("/query/operands/1/operands/1/wrap/key")
-                .asText());
+        assertEquals("operation:sequence",
+                res.at("/query/operands/0/operation").asText());
+        assertEquals("koral:token",
+                res.at("/query/operands/0/operands/0/@type").asText());
+        assertEquals("der",
+                res.at("/query/operands/0/operands/0/wrap/key").asText());
+        assertEquals("katze",
+                res.at("/query/operands/0/operands/1/wrap/key").asText());
+        assertEquals("eine",
+                res.at("/query/operands/1/operands/0/wrap/key").asText());
+        assertEquals("baum",
+                res.at("/query/operands/1/operands/1/wrap/key").asText());
 
         query = "[orth=der][base=katze]|[orth=eine][base=baum]";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:group", res.at("/query/@type").asText());
-        assertEquals("operation:disjunction", res.at("/query/operation")
-                .asText());
+        assertEquals("operation:disjunction",
+                res.at("/query/operation").asText());
         assertEquals("koral:group", res.at("/query/operands/0/@type").asText());
-        assertEquals("operation:sequence", res
-                .at("/query/operands/0/operation").asText());
-        assertEquals("koral:token", res
-                .at("/query/operands/0/operands/0/@type").asText());
-        assertEquals("der", res.at("/query/operands/0/operands/0/wrap/key")
-                .asText());
-        assertEquals("katze", res.at("/query/operands/0/operands/1/wrap/key")
-                .asText());
-        assertEquals("eine", res.at("/query/operands/1/operands/0/wrap/key")
-                .asText());
-        assertEquals("baum", res.at("/query/operands/1/operands/1/wrap/key")
-                .asText());
+        assertEquals("operation:sequence",
+                res.at("/query/operands/0/operation").asText());
+        assertEquals("koral:token",
+                res.at("/query/operands/0/operands/0/@type").asText());
+        assertEquals("der",
+                res.at("/query/operands/0/operands/0/wrap/key").asText());
+        assertEquals("katze",
+                res.at("/query/operands/0/operands/1/wrap/key").asText());
+        assertEquals("eine",
+                res.at("/query/operands/1/operands/0/wrap/key").asText());
+        assertEquals("baum",
+                res.at("/query/operands/1/operands/1/wrap/key").asText());
 
         query = "[orth=der]([base=katze]|[orth=eine])[base=baum]";
         qs.setQuery(query, "poliqarpplus");
@@ -1315,19 +1291,19 @@
         assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
         assertEquals("koral:token", res.at("/query/operands/2/@type").asText());
         assertEquals("der", res.at("/query/operands/0/wrap/key").asText());
-        assertEquals("katze", res.at("/query/operands/1/operands/0/wrap/key")
-                .asText());
-        assertEquals("eine", res.at("/query/operands/1/operands/1/wrap/key")
-                .asText());
+        assertEquals("katze",
+                res.at("/query/operands/1/operands/0/wrap/key").asText());
+        assertEquals("eine",
+                res.at("/query/operands/1/operands/1/wrap/key").asText());
         assertEquals("baum", res.at("/query/operands/2/wrap/key").asText());
 
         query = "[orth=der][base=katze]|[orth=der][base=hund]|[orth=der][base=baum]";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
-        assertEquals("der", res.at("/query/operands/2/operands/0/wrap/key")
-                .asText());
-        assertEquals("baum", res.at("/query/operands/2/operands/1/wrap/key")
-                .asText());
+        assertEquals("der",
+                res.at("/query/operands/2/operands/0/wrap/key").asText());
+        assertEquals("baum",
+                res.at("/query/operands/2/operands/1/wrap/key").asText());
 
         query = "[orth=der]([base=katze]|[base=hund]|[base=baum])";
         qs.setQuery(query, "poliqarpplus");
@@ -1338,24 +1314,24 @@
         assertEquals("operation:disjunction",
                 res.at("/query/operands/1/operation").asText());
         assertEquals("koral:token", res.at("/query/operands/0/@type").asText());
-        assertEquals("koral:token", res
-                .at("/query/operands/1/operands/0/@type").asText());
-        assertEquals("koral:token", res
-                .at("/query/operands/1/operands/1/@type").asText());
-        assertEquals("koral:token", res
-                .at("/query/operands/1/operands/2/@type").asText());
-        assertEquals("katze", res.at("/query/operands/1/operands/0/wrap/key")
-                .asText());
-        assertEquals("hund", res.at("/query/operands/1/operands/1/wrap/key")
-                .asText());
-        assertEquals("baum", res.at("/query/operands/1/operands/2/wrap/key")
-                .asText());
+        assertEquals("koral:token",
+                res.at("/query/operands/1/operands/0/@type").asText());
+        assertEquals("koral:token",
+                res.at("/query/operands/1/operands/1/@type").asText());
+        assertEquals("koral:token",
+                res.at("/query/operands/1/operands/2/@type").asText());
+        assertEquals("katze",
+                res.at("/query/operands/1/operands/0/wrap/key").asText());
+        assertEquals("hund",
+                res.at("/query/operands/1/operands/1/wrap/key").asText());
+        assertEquals("baum",
+                res.at("/query/operands/1/operands/2/wrap/key").asText());
     }
 
 
     @Test
-    public void testTokenSpanSequence () throws JsonProcessingException,
-            IOException {
+    public void testTokenSpanSequence ()
+            throws JsonProcessingException, IOException {
         query = "[base=Mann]<vp>";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
@@ -1408,27 +1384,27 @@
         assertEquals("operation:class", res.at("/query/operation").asText());
         assertEquals(1, res.at("/query/classOut").asInt());
         assertEquals(true, res.at("/query/classIn").isMissingNode());
-        assertEquals("Mann", res.at("/query/operands/0/operands/0/wrap/key")
-                .asText());
-        assertEquals("Frau", res.at("/query/operands/0/operands/1/wrap/key")
-                .asText());
+        assertEquals("Mann",
+                res.at("/query/operands/0/operands/0/wrap/key").asText());
+        assertEquals("Frau",
+                res.at("/query/operands/0/operands/1/wrap/key").asText());
 
         query = "{[base=Mann]}{[orth=Frau]}";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:sequence", res.at("/query/operation").asText());
-        assertEquals("operation:class", res.at("/query/operands/0/operation")
-                .asText());
+        assertEquals("operation:class",
+                res.at("/query/operands/0/operation").asText());
         assertEquals(1, res.at("/query/operands/0/classOut").asInt());
-        assertEquals("operation:class", res.at("/query/operands/1/operation")
-                .asText());
+        assertEquals("operation:class",
+                res.at("/query/operands/1/operation").asText());
         assertEquals(1, res.at("/query/operands/1/classOut").asInt());
         assertEquals(true, res.at("/query/classIn").isMissingNode());
-        assertEquals("Mann", res.at("/query/operands/0/operands/0/wrap/key")
-                .asText());
-        assertEquals("Frau", res.at("/query/operands/1/operands/0/wrap/key")
-                .asText());
+        assertEquals("Mann",
+                res.at("/query/operands/0/operands/0/wrap/key").asText());
+        assertEquals("Frau",
+                res.at("/query/operands/1/operands/0/wrap/key").asText());
 
         query = "[p=NN]{[base=Mann][orth=Frau]}";
         qs.setQuery(query, "poliqarpplus");
@@ -1436,8 +1412,8 @@
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:sequence", res.at("/query/operation").asText());
         assertEquals("koral:group", res.at("/query/operands/1/@type").asText());
-        assertEquals("operation:class", res.at("/query/operands/1/operation")
-                .asText());
+        assertEquals("operation:class",
+                res.at("/query/operands/1/operation").asText());
         assertEquals(1, res.at("/query/operands/1/classOut").asInt());
         assertEquals(true, res.at("/query/operands/1/classIn").isMissingNode());
         assertEquals("Mann",
@@ -1453,8 +1429,8 @@
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:sequence", res.at("/query/operation").asText());
         assertEquals("koral:group", res.at("/query/operands/0/@type").asText());
-        assertEquals("operation:class", res.at("/query/operands/0/operation")
-                .asText());
+        assertEquals("operation:class",
+                res.at("/query/operands/0/operation").asText());
         assertEquals(1, res.at("/query/operands/0/classOut").asInt());
         assertEquals(true, res.at("/query/operands/0/classIn").isMissingNode());
         assertEquals("Mann",
@@ -1470,10 +1446,11 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:class", res.at("/query/operation").asText());
-        assertEquals("operation:sequence", res
-                .at("/query/operands/0/operation").asText());
+        assertEquals("operation:sequence",
+                res.at("/query/operands/0/operation").asText());
         assertEquals(2, res.at("/query/classOut").asInt());
-        assertEquals(1, res.at("/query/operands/0/operands/0/classOut").asInt());
+        assertEquals(1,
+                res.at("/query/operands/0/operands/0/classOut").asInt());
         assertEquals(2, res.at("/meta/highlight/0").asInt());
         assertEquals(1, res.at("/meta/highlight/1").asInt());
     }
@@ -1487,11 +1464,12 @@
         assertEquals("koral:reference", res.at("/query/@type").asText());
         assertEquals("operation:focus", res.at("/query/operation").asText());
         assertEquals(1, res.at("/query/classRef/0").asInt());
-        assertEquals("operation:sequence", res
-                .at("/query/operands/0/operation").asText());
+        assertEquals("operation:sequence",
+                res.at("/query/operands/0/operation").asText());
         assertEquals("operation:class",
                 res.at("/query/operands/0/operands/1/operation").asText());
-        assertEquals(1, res.at("/query/operands/0/operands/1/classOut").asInt());
+        assertEquals(1,
+                res.at("/query/operands/0/operands/1/classOut").asInt());
         assertEquals("Mann",
                 res.at("/query/operands/0/operands/1/operands/0/wrap/key")
                         .asText());
@@ -1503,12 +1481,10 @@
         assertEquals("operation:sequence",
                 res.at("/query/operands/0/operands/1/operands/0/operation")
                         .asText());
-        assertEquals(
-                "Mann",
+        assertEquals("Mann",
                 res.at("/query/operands/0/operands/1/operands/0/operands/0/wrap/key")
                         .asText());
-        assertEquals(
-                "geht",
+        assertEquals("geht",
                 res.at("/query/operands/0/operands/1/operands/0/operands/1/wrap/key")
                         .asText());
 
@@ -1516,7 +1492,8 @@
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals(2, res.at("/query/classRef/0").asInt());
-        assertEquals(2, res.at("/query/operands/0/operands/1/classOut").asInt());
+        assertEquals(2,
+                res.at("/query/operands/0/operands/1/classOut").asInt());
         assertEquals(2, res.at("/meta/highlight/0").asInt());
 
         query = "focus(3:startswith(<s>,{3:<np>}))";
@@ -1525,21 +1502,22 @@
         assertEquals(3, res.at("/query/classRef/0").asInt());
         assertEquals("koral:reference", res.at("/query/@type").asText());
         assertEquals("operation:focus", res.at("/query/operation").asText());
-        assertEquals("operation:position", res
-                .at("/query/operands/0/operation").asText());
+        assertEquals("operation:position",
+                res.at("/query/operands/0/operation").asText());
         assertEquals("operation:class",
                 res.at("/query/operands/0/operands/1/operation").asText());
-        assertEquals(3, res.at("/query/operands/0/operands/1/classOut").asInt());
-        assertEquals("frames:startsWith", res.at("/query/operands/0/frames/0")
-                .asText());
+        assertEquals(3,
+                res.at("/query/operands/0/operands/1/classOut").asInt());
+        assertEquals("frames:startsWith",
+                res.at("/query/operands/0/frames/0").asText());
         assertEquals(3, res.at("/meta/highlight/0").asInt());
 
         query = "focus(1000:startswith(<s>,{1000:<np>}))";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals(1000, res.at("/query/classRef/0").asInt());
-        assertEquals(1000, res.at("/query/operands/0/operands/1/classOut")
-                .asInt());
+        assertEquals(1000,
+                res.at("/query/operands/0/operands/1/classOut").asInt());
         assertEquals(1000, res.at("/meta/highlight/0").asInt());
 
         query = "focus(3: startswith(<s>, {3:[base=der]{1:[mate/p=ADJA]{2:[tt/p=NN]}}}))";
@@ -1548,34 +1526,30 @@
         assertEquals(3, res.at("/query/classRef/0").asInt());
         assertEquals("koral:reference", res.at("/query/@type").asText());
         assertEquals("operation:focus", res.at("/query/operation").asText());
-        assertEquals("operation:position", res
-                .at("/query/operands/0/operation").asText());
-        assertEquals("frames:startsWith", res.at("/query/operands/0/frames/0")
-                .asText());
+        assertEquals("operation:position",
+                res.at("/query/operands/0/operation").asText());
+        assertEquals("frames:startsWith",
+                res.at("/query/operands/0/frames/0").asText());
         assertEquals("operation:class",
                 res.at("/query/operands/0/operands/1/operation").asText());
-        assertEquals(3, res.at("/query/operands/0/operands/1/classOut").asInt());
+        assertEquals(3,
+                res.at("/query/operands/0/operands/1/classOut").asInt());
         assertEquals("operation:sequence",
                 res.at("/query/operands/0/operands/1/operands/0/operation")
                         .asText());
-        assertEquals(
-                "operation:class",
+        assertEquals("operation:class",
                 res.at("/query/operands/0/operands/1/operands/0/operands/1/operation")
                         .asText());
-        assertEquals(
-                1,
+        assertEquals(1,
                 res.at("/query/operands/0/operands/1/operands/0/operands/1/classOut")
                         .asInt());
-        assertEquals(
-                "operation:sequence",
+        assertEquals("operation:sequence",
                 res.at("/query/operands/0/operands/1/operands/0/operands/1/operands/0/operation")
                         .asText());
-        assertEquals(
-                "operation:class",
+        assertEquals("operation:class",
                 res.at("/query/operands/0/operands/1/operands/0/operands/1/operands/0/operands/1/operation")
                         .asText());
-        assertEquals(
-                2,
+        assertEquals(2,
                 res.at("/query/operands/0/operands/1/operands/0/operands/1/operands/0/operands/1/classOut")
                         .asInt());
 
@@ -1592,8 +1566,8 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals(2, res.at("/query/classRef/0").asInt());
         assertEquals(3, res.at("/query/classRef/1").asInt());
-        assertEquals("classRefOp:intersection", res.at("/query/classRefOp")
-                .asText());
+        assertEquals("classRefOp:intersection",
+                res.at("/query/classRefOp").asText());
         assertEquals("koral:reference", res.at("/query/@type").asText());
         assertEquals("operation:split", res.at("/query/operation").asText());
         assertEquals(3, res.at("/meta/highlight/0").asInt());
@@ -1604,8 +1578,10 @@
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals(1, res.at("/query/classRef/0").asInt());
-        assertEquals(1, res.at("/query/operands/0/operands/0/classOut").asInt());
-        assertEquals(1, res.at("/query/operands/0/operands/1/classOut").asInt());
+        assertEquals(1,
+                res.at("/query/operands/0/operands/0/classOut").asInt());
+        assertEquals(1,
+                res.at("/query/operands/0/operands/1/classOut").asInt());
     }
 
 
@@ -1635,12 +1611,12 @@
         assertEquals("operation:focus", res.at("/query/operation").asText());
         assertEquals(1, res.at("/query/spanRef/0").asInt());
         assertEquals(4, res.at("/query/spanRef/1").asInt());
-        assertEquals("frames:isAround", res.at("/query/operands/0/frames/0")
-                .asText());
-        assertEquals("s", res.at("/query/operands/0/operands/0/wrap/key")
-                .asText());
-        assertEquals("Haus", res.at("/query/operands/0/operands/1/wrap/key")
-                .asText());
+        assertEquals("frames:isAround",
+                res.at("/query/operands/0/frames/0").asText());
+        assertEquals("s",
+                res.at("/query/operands/0/operands/0/wrap/key").asText());
+        assertEquals("Haus",
+                res.at("/query/operands/0/operands/1/wrap/key").asText());
     }
 
 
@@ -1651,7 +1627,8 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:relation", res.at("/query/operation").asText());
-        assertEquals("koral:relation", res.at("/query/relation/@type").asText());
+        assertEquals("koral:relation",
+                res.at("/query/relation/@type").asText());
         assertEquals("c", res.at("/query/relation/wrap/layer").asText());
         assertEquals("s", res.at("/query/operands/0/wrap/key").asText());
         assertEquals("np", res.at("/query/operands/1/wrap/key").asText());
@@ -1661,7 +1638,8 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:relation", res.at("/query/operation").asText());
-        assertEquals("koral:relation", res.at("/query/relation/@type").asText());
+        assertEquals("koral:relation",
+                res.at("/query/relation/@type").asText());
         assertEquals("Baum", res.at("/query/operands/0/wrap/key").asText());
         assertEquals("np", res.at("/query/operands/1/wrap/key").asText());
 
@@ -1676,7 +1654,8 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("lemma", res.at("/query/operands/1/wrap/layer").asText());
         assertEquals("Baum", res.at("/query/operands/1/wrap/key").asText());
-        assertEquals("koral:relation", res.at("/query/relation/@type").asText());
+        assertEquals("koral:relation",
+                res.at("/query/relation/@type").asText());
         assertEquals("mate", res.at("/query/relation/wrap/foundry").asText());
         assertEquals("d", res.at("/query/relation/wrap/layer").asText());
         assertEquals("HEAD", res.at("/query/relation/wrap/key").asText());
@@ -1688,7 +1667,8 @@
         assertEquals("fällen", res.at("/query/operands/0/wrap/key").asText());
         assertEquals("lemma", res.at("/query/operands/1/wrap/layer").asText());
         assertEquals("Baum", res.at("/query/operands/1/wrap/key").asText());
-        assertEquals("koral:relation", res.at("/query/relation/@type").asText());
+        assertEquals("koral:relation",
+                res.at("/query/relation/@type").asText());
         assertEquals("d", res.at("/query/relation/wrap/layer").asText());
 
         query = "dominates(Baum,<np>)";
@@ -1696,7 +1676,8 @@
         res = mapper.readTree(qs.toJSON());
         assertEquals("orth", res.at("/query/operands/0/wrap/layer").asText());
         assertEquals("Baum", res.at("/query/operands/0/wrap/key").asText());
-        assertEquals("koral:relation", res.at("/query/relation/@type").asText());
+        assertEquals("koral:relation",
+                res.at("/query/relation/@type").asText());
         assertEquals("c", res.at("/query/relation/wrap/layer").asText());
 
         query = "dominates(cnx/c:<vp>,<np>)";
@@ -1711,8 +1692,8 @@
         assertEquals("cnx", res.at("/query/relation/wrap/foundry").asText());
         assertEquals("c", res.at("/query/relation/wrap/layer").asText());
         assertEquals(0, res.at("/query/relation/boundary/min").asInt());
-        assertEquals(true, res.at("/query/relation/boundary/max")
-                .isMissingNode());
+        assertEquals(true,
+                res.at("/query/relation/boundary/max").isMissingNode());
 
         query = "dominates(cnx/c{1,5}:<vp>,<np>)";
         qs.setQuery(query, "poliqarpplus");
@@ -1740,13 +1721,13 @@
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals("operation:sequence", res.at("/query/operation").asText());
-        assertEquals("der", res.at("/query/operands/0/operands/0/wrap/key")
-                .asText());
+        assertEquals("der",
+                res.at("/query/operands/0/operands/0/wrap/key").asText());
         assertEquals(1, res.at("/query/operands/0/classOut").asInt());
-        assertEquals("Mann", res.at("/query/operands/1/operands/0/wrap/key")
-                .asText());
-        assertEquals("operation:class", res.at("/query/operands/1/operation")
-                .asText());
+        assertEquals("Mann",
+                res.at("/query/operands/1/operands/0/wrap/key").asText());
+        assertEquals("operation:class",
+                res.at("/query/operands/1/operation").asText());
         assertEquals(2, res.at("/query/operands/1/classOut").asInt());
         assertEquals(1, res.at("/meta/alignment/0/0").asInt());
         assertEquals(2, res.at("/meta/alignment/0/1").asInt());
@@ -1755,13 +1736,13 @@
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
         assertEquals("operation:sequence", res.at("/query/operation").asText());
-        assertEquals("der", res.at("/query/operands/0/operands/0/wrap/key")
-                .asText());
+        assertEquals("der",
+                res.at("/query/operands/0/operands/0/wrap/key").asText());
         assertEquals(1, res.at("/query/operands/0/classOut").asInt());
-        assertEquals("große", res.at("/query/operands/1/operands/0/wrap/key")
-                .asText());
-        assertEquals("operation:class", res.at("/query/operands/1/operation")
-                .asText());
+        assertEquals("große",
+                res.at("/query/operands/1/operands/0/wrap/key").asText());
+        assertEquals("operation:class",
+                res.at("/query/operands/1/operation").asText());
         assertEquals(2, res.at("/query/operands/1/classOut").asInt());
         assertEquals("Mann", res.at("/query/operands/2/wrap/key").asText());
         assertEquals(1, res.at("/meta/alignment/0/0").asInt());
@@ -1771,10 +1752,10 @@
         query = "([base=a]^[base=b])|[base=c]";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
-        assertEquals("operation:disjunction", res.at("/query/operation")
-                .asText());
-        assertEquals("operation:sequence", res
-                .at("/query/operands/0/operation").asText());
+        assertEquals("operation:disjunction",
+                res.at("/query/operation").asText());
+        assertEquals("operation:sequence",
+                res.at("/query/operands/0/operation").asText());
         assertEquals("operation:class",
                 res.at("/query/operands/0/operands/1/operation").asText());
         assertEquals("a",
@@ -1784,8 +1765,10 @@
                 res.at("/query/operands/0/operands/1/operands/0/wrap/key")
                         .asText());
         assertEquals("c", res.at("/query/operands/1/wrap/key").asText());
-        assertEquals(1, res.at("/query/operands/0/operands/0/classOut").asInt());
-        assertEquals(2, res.at("/query/operands/0/operands/1/classOut").asInt());
+        assertEquals(1,
+                res.at("/query/operands/0/operands/0/classOut").asInt());
+        assertEquals(2,
+                res.at("/query/operands/0/operands/1/classOut").asInt());
         assertEquals(1, res.at("/meta/alignment/0/0").asInt());
         assertEquals(2, res.at("/meta/alignment/0/1").asInt());
 
@@ -1798,8 +1781,8 @@
         assertEquals("b",
                 res.at("/query/operands/0/operands/1/operands/0/wrap/key")
                         .asText());
-        assertEquals("c", res.at("/query/operands/0/operands/2/wrap/key")
-                .asText());
+        assertEquals("c",
+                res.at("/query/operands/0/operands/2/wrap/key").asText());
         assertEquals("d", res.at("/query/operands/1/wrap/key").asText());
 
         query = "([base=a]^[base=b]^[base=c])|[base=d]";
@@ -1808,15 +1791,18 @@
         assertEquals("a",
                 res.at("/query/operands/0/operands/0/operands/0/wrap/key")
                         .asText());
-        assertEquals(1, res.at("/query/operands/0/operands/0/classOut").asInt());
+        assertEquals(1,
+                res.at("/query/operands/0/operands/0/classOut").asInt());
         assertEquals("b",
                 res.at("/query/operands/0/operands/1/operands/0/wrap/key")
                         .asText());
-        assertEquals(2, res.at("/query/operands/0/operands/1/classOut").asInt());
+        assertEquals(2,
+                res.at("/query/operands/0/operands/1/classOut").asInt());
         assertEquals("c",
                 res.at("/query/operands/0/operands/2/operands/0/wrap/key")
                         .asText());
-        assertEquals(3, res.at("/query/operands/0/operands/2/classOut").asInt());
+        assertEquals(3,
+                res.at("/query/operands/0/operands/2/classOut").asInt());
         assertEquals("d", res.at("/query/operands/1/wrap/key").asText());
         assertEquals(1, res.at("/meta/alignment/0/0").asInt());
         assertEquals(2, res.at("/meta/alignment/0/1").asInt());
@@ -1844,8 +1830,8 @@
 
 
     @Test
-    public void testSimpleQueries () throws JsonProcessingException,
-            IOException {
+    public void testSimpleQueries ()
+            throws JsonProcessingException, IOException {
         query = "Baum";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
@@ -1861,16 +1847,16 @@
         assertEquals("koral:group", res.at("/query/@type").asText());
         assertEquals("operation:sequence", 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("Der", res.at("/query/operands/0/wrap/key").asText());
         assertEquals("Baum", res.at("/query/operands/1/wrap/key").asText());
         assertEquals("orth", res.at("/query/operands/0/wrap/layer").asText());
-        assertEquals("match:eq", res.at("/query/operands/0/wrap/match")
-                .asText());
+        assertEquals("match:eq",
+                res.at("/query/operands/0/wrap/match").asText());
         assertEquals("orth", res.at("/query/operands/1/wrap/layer").asText());
-        assertEquals("match:eq", res.at("/query/operands/1/wrap/match")
-                .asText());
+        assertEquals("match:eq",
+                res.at("/query/operands/1/wrap/match").asText());
 
         query = "Der große Baum";
         qs.setQuery(query, "poliqarpplus");
@@ -1885,29 +1871,29 @@
         assertEquals("Der", res.at("/query/operands/0/wrap/key").asText());
         assertEquals("operation:disjunction",
                 res.at("/query/operands/1/operation").asText());
-        assertEquals("große", res.at("/query/operands/1/operands/0/wrap/key")
-                .asText());
-        assertEquals("kleine", res.at("/query/operands/1/operands/1/wrap/key")
-                .asText());
+        assertEquals("große",
+                res.at("/query/operands/1/operands/0/wrap/key").asText());
+        assertEquals("kleine",
+                res.at("/query/operands/1/operands/1/wrap/key").asText());
         assertEquals("Baum", res.at("/query/operands/2/wrap/key").asText());
 
         query = "der große Baum | der kleine Baum";
         qs.setQuery(query, "poliqarpplus");
         res = mapper.readTree(qs.toJSON());
-        assertEquals("operation:disjunction", res.at("/query/operation")
-                .asText());
-        assertEquals("der", res.at("/query/operands/0/operands/0/wrap/key")
-                .asText());
-        assertEquals("große", res.at("/query/operands/0/operands/1/wrap/key")
-                .asText());
-        assertEquals("Baum", res.at("/query/operands/0/operands/2/wrap/key")
-                .asText());
-        assertEquals("der", res.at("/query/operands/1/operands/0/wrap/key")
-                .asText());
-        assertEquals("kleine", res.at("/query/operands/1/operands/1/wrap/key")
-                .asText());
-        assertEquals("Baum", res.at("/query/operands/1/operands/2/wrap/key")
-                .asText());
+        assertEquals("operation:disjunction",
+                res.at("/query/operation").asText());
+        assertEquals("der",
+                res.at("/query/operands/0/operands/0/wrap/key").asText());
+        assertEquals("große",
+                res.at("/query/operands/0/operands/1/wrap/key").asText());
+        assertEquals("Baum",
+                res.at("/query/operands/0/operands/2/wrap/key").asText());
+        assertEquals("der",
+                res.at("/query/operands/1/operands/0/wrap/key").asText());
+        assertEquals("kleine",
+                res.at("/query/operands/1/operands/1/wrap/key").asText());
+        assertEquals("Baum",
+                res.at("/query/operands/1/operands/2/wrap/key").asText());
 
         query = "Der [p=ADJA] Baum";
         qs.setQuery(query, "poliqarpplus");
@@ -1932,8 +1918,8 @@
 
 
     @Test
-    public void testSpanSerialization () throws JsonProcessingException,
-            IOException {
+    public void testSpanSerialization ()
+            throws JsonProcessingException, IOException {
 
         // Both constructs should be serialized identically
         query = "contains(<s>, der)";
@@ -1977,7 +1963,8 @@
         assertEquals("x", res.at("/query/wrap/key").asText());
         assertEquals("koral:docGroup", res.at("/collection/@type").asText());
         assertEquals("operation:and", res.at("/collection/operation").asText());
-        assertEquals("textClass", res.at("/collection/operands/0/key").asText());
+        assertEquals("textClass",
+                res.at("/collection/operands/0/key").asText());
         assertEquals("Sport", res.at("/collection/operands/0/value").asText());
         assertEquals("author", res.at("/collection/operands/1/key").asText());
         assertEquals("Smith", res.at("/collection/operands/1/value").asText());
