### Question:
QueryBuilders { static TermsQueryBuilder termsQuery( String name, Iterable<?> values ) { return new TermsQueryBuilder( name, values ); } private  QueryBuilders();   }### Answer:
@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 ) ) ) ); }