@Test
  public void testUnsupportedAsyncIndexes() throws RegionNotFoundException, IndexInvalidException,
      IndexNameConflictException, IndexExistsException {
    RegionFactory<Object, Object> rf = gfc.createRegionFactory();
    rf.setOffHeap(true);
    rf.setIndexMaintenanceSynchronous(false);
    rf.create("r");
    QueryService qs = gfc.getQueryService();
    try {
      qs.createIndex("idx", "age", SEPARATOR + "r");
      fail("expected UnsupportedOperationException");
    } catch (UnsupportedOperationException expected) {
      assertEquals(
          "Asynchronous index maintenance is currently not supported for off-heap regions. The off-heap region is "
              + SEPARATOR + "r",
          expected.getMessage());
    }
  }
Test off-heap regions with indexes.
geode-core/src/integrationTest/java/org/apache/geode/internal/offheap/OffHeapIndexJUnitTest.java