TermQueryConverter implements QueryConverter { @Override public String convert() { String key = this.fieldConverter.convertKey(this.query.getTerm().field()); String value = this.fieldConverter.convertValue(this.query.getTerm().text()); return key + this.getOperator(this.query.getTerm().field()) + this.convertValue(value); } TermQueryConverter(TermQuery query,
                              FieldConverter fieldConverter); @Override String convert();  }
@Test public void test() { TermQuery query = new TermQuery(new Term("a.term", termText)); QueryConverter converter = new TermQueryConverter(query, new FieldConverterImpl()); String queryString = converter.convert(); assertThat(queryString).isEqualTo(expectedConversionResult); }