### Question:
ElasticsearchItemReader extends AbstractPaginatedDataItemReader<T> implements InitializingBean { @Override @SuppressWarnings("unchecked") protected Iterator<T> doPageRead() { logger.debug("executing query {}", query.getQuery()); return (Iterator<T>)elasticsearchOperations.queryForList(query, targetType).iterator(); } ElasticsearchItemReader(ElasticsearchOperations elasticsearchOperations, SearchQuery query, Class<? extends T> targetType); @Override void afterPropertiesSet();  }### Answer:
@Test public void shouldQueryForList() { when(elasticsearchOperations.queryForList(query, Object.class)).thenReturn(asList()); reader.doPageRead(); verify(elasticsearchOperations).queryForList(query, Object.class); }