@Test
  public void shouldNotUseOffHeapForInternalRegionsWhenUserRegionHasOffHeap() {
    createIndex(cache, "text");
    cache.createRegionFactory(RegionShortcut.PARTITION).setOffHeap(true).create(REGION_NAME);

    verifyInternalRegions(region -> {
      assertEquals(false, region.getOffHeap());
    });
  }
Tests of lucene index creation that use off heap memory
geode-lucene/src/integrationTest/java/org/apache/geode/cache/lucene/LuceneIndexCreationOffHeapIntegrationTest.java