@Test
  public void range() throws Exception {
    assertEquals("{\"range\":{\"f\":{\"lt\":0}}}",
            toJson(QueryBuilders.rangeQuery("f").lt(0)));
    assertEquals("{\"range\":{\"f\":{\"gt\":0}}}",
            toJson(QueryBuilders.rangeQuery("f").gt(0)));
    assertEquals("{\"range\":{\"f\":{\"gte\":0}}}",
            toJson(QueryBuilders.rangeQuery("f").gte(0)));
    assertEquals("{\"range\":{\"f\":{\"lte\":0}}}",
            toJson(QueryBuilders.rangeQuery("f").lte(0)));
    assertEquals("{\"range\":{\"f\":{\"gt\":1,\"lt\":2}}}",
            toJson(QueryBuilders.rangeQuery("f").gt(1).lt(2)));
    assertEquals("{\"range\":{\"f\":{\"gt\":11,\"lt\":0}}}",
            toJson(QueryBuilders.rangeQuery("f").lt(0).gt(11)));
    assertEquals("{\"range\":{\"f\":{\"gt\":1,\"lte\":2}}}",
            toJson(QueryBuilders.rangeQuery("f").gt(1).lte(2)));
    assertEquals("{\"range\":{\"f\":{\"gte\":1,\"lte\":\"zz\"}}}",
            toJson(QueryBuilders.rangeQuery("f").gte(1).lte("zz")));
    assertEquals("{\"range\":{\"f\":{\"gte\":1}}}",
            toJson(QueryBuilders.rangeQuery("f").gte(1)));
    assertEquals("{\"range\":{\"f\":{\"gte\":\"zz\"}}}",
            toJson(QueryBuilders.rangeQuery("f").gte("zz")));
    assertEquals("{\"range\":{\"f\":{\"gt\":\"a\",\"lt\":\"z\"}}}",
            toJson(QueryBuilders.rangeQuery("f").gt("a").lt("z")));
    assertEquals("{\"range\":{\"f\":{\"gte\":3}}}",
            toJson(QueryBuilders.rangeQuery("f").gt(1).gt(2).gte(3)));
    assertEquals("{\"range\":{\"f\":{\"lte\":3}}}",
            toJson(QueryBuilders.rangeQuery("f").lt(1).lt(2).lte(3)));
  }
Test for simple scalar terms (boolean, int etc.)
@throws Exception not expected
criteria/elasticsearch/test/org/immutables/criteria/elasticsearch/QueryBuildersTest.java