SolrQueryExecutor implements QueryExecutor { @Override public <T, R> R findOne(Query<T, R> query) { SolrQuery solrQuery = translate(query); solrQuery.setRows(1); List<R> list = fetch(solrQuery, query.getReturnType()); return list.size() > 0 ? list.get(0) : null; } SolrQueryExecutor(SolrServer solrServer,
            SolrQueryTranslator queryTranslator); @Override Iterable<R> find(Query<T, R> query); @Override R findOne(Query<T, R> query); T save(T entity); Iterable<T> save(Iterable<T> entities);  }
@Test public void findOne() { setResponse(t1); TestClass found = executor.findOne(query); assertEquals(t1, found); verify(queryTranslator).translate(query); }