@Test
  public void shouldReturnCorrectResultsOnMultipleDeletionsAfterQueryExecution() throws Exception {
    final LuceneQuery<Object, Object> query = addValuesAndCreateQuery(2);

    final PageableLuceneQueryResults<Object, Object> pages = query.findPages();
    List<LuceneResultStruct<Object, Object>> allEntries = new ArrayList<>();

    assertTrue(pages.hasNext());
    assertEquals(7, pages.size());

    // Destroying an entry from the region after the query is executed.
    region.destroy("C");
    allEntries.addAll(pages.next());

    // Destroying an entry from allEntries and the region after it is fetched through pages.next().
    Object removeKey = allEntries.remove(0).getKey();
    region.destroy(removeKey);
    allEntries.addAll(pages.next());

    // Destroying a region entry which has't been fetched through pages.next() yet.
    Set resultKeySet =
        allEntries.stream().map(LuceneResultStruct::getKey).collect(Collectors.toSet());

    for (Object key : region.keySet()) {
      if (!resultKeySet.contains(key)) {
        region.destroy(key);
        break;
      }
    }

    allEntries.addAll(pages.next());
    assertFalse(pages.hasNext());

    assertEquals(region.keySet(),
        allEntries.stream().map(LuceneResultStruct::getKey).collect(Collectors.toSet()));
    assertEquals(region.values(),
        allEntries.stream().map(LuceneResultStruct::getValue).collect(Collectors.toSet()));
  }
This class contains tests of lucene queries that can fit
geode-lucene/src/integrationTest/java/org/apache/geode/cache/lucene/LuceneQueriesIntegrationTest.java