@Test
  public void testSubcontextNonEmptyDestruction() throws Exception {
    // Bind some object in ejb subcontext
    dataSourceContext.bind("Test", "Object");
    // Attempt to destroy any subcontext
    try {
      initialContext.destroySubcontext("java:gf");
      fail();
    } catch (ContextNotEmptyException expected) {
    }
    try {
      initialContext.destroySubcontext("java:gf/env/datasource");
      fail();
    } catch (ContextNotEmptyException expected) {
    }
    try {
      envContext.destroySubcontext("datasource");
      fail();
    } catch (ContextNotEmptyException expected) {
    }
  }
Tests inability to destroy non empty subcontexts.
geode-core/src/test/java/org/apache/geode/internal/jndi/ContextJUnitTest.java