@Test
public void query() throws IOException {

  when(rw.run(query)).thenReturn(queryResults);
  when(queryResults.results()).thenReturn(Stream.of(entity1, entity2).iterator());
  assertThat(sut.query(query), contains(entity1, entity2));
  verify(rw).run(query);
}