@Test
  public void testSubcontextDestruction() throws Exception {
    // Create three new subcontexts
    dataSourceContext.createSubcontext("sub1");
    dataSourceContext.createSubcontext("sub2");
    envContext.createSubcontext("sub3");
    // Destroy
    initialContext.destroySubcontext("java:gf/env/datasource/sub1");
    dataSourceContext.destroySubcontext("sub2");
    envContext.destroySubcontext("sub3");
    // Perform lookup
    try {
      dataSourceContext.lookup("sub1");
      fail();
    } catch (NameNotFoundException expected) {
    }
    try {
      envContext.lookup("datasource/sub2");
      fail();
    } catch (NameNotFoundException expected) {
    }
    try {
      initialContext.lookup("java:gf/sub3");
      fail();
    } catch (NameNotFoundException expected) {
    }
  }
Tests ability to destroy empty subcontexts.
geode-core/src/test/java/org/apache/geode/internal/jndi/ContextJUnitTest.java