@Test
  public void terms() throws Exception {
    assertEquals("{\"terms\":{\"foo\":[]}}",
            toJson(QueryBuilders.termsQuery("foo", Collections.emptyList())));

    assertEquals("{\"terms\":{\"bar\":[]}}",
            toJson(QueryBuilders.termsQuery("bar", Collections.emptySet())));

    assertEquals("{\"terms\":{\"singleton\":[0]}}",
            toJson(QueryBuilders.termsQuery("singleton", Collections.singleton(0))));

    assertEquals("{\"terms\":{\"foo\":[true]}}",
            toJson(QueryBuilders.termsQuery("foo", Collections.singleton(true))));

    assertEquals("{\"terms\":{\"foo\":[\"bar\"]}}",
            toJson(QueryBuilders.termsQuery("foo", Collections.singleton("bar"))));

    assertEquals("{\"terms\":{\"foo\":[\"bar\"]}}",
            toJson(QueryBuilders.termsQuery("foo", Collections.singletonList("bar"))));

    assertEquals("{\"terms\":{\"foo\":[true,false]}}",
            toJson(QueryBuilders.termsQuery("foo", Arrays.asList(true, false))));

    assertEquals("{\"terms\":{\"foo\":[1,2,3]}}",
            toJson(QueryBuilders.termsQuery("foo", Arrays.asList(1, 2, 3))));

    assertEquals("{\"terms\":{\"foo\":[1.1,2.2,3.3]}}",
            toJson(QueryBuilders.termsQuery("foo", Arrays.asList(1.1, 2.2, 3.3))));
  }
Test for simple scalar terms (boolean, int etc.)
@throws Exception not expected
criteria/elasticsearch/test/org/immutables/criteria/elasticsearch/QueryBuildersTest.java