@Test
  public void testSubcontextCreationOfDuplicates() throws NamingException {
    // Try to create duplicate subcontext
    try {
      initialContext.createSubcontext("java:gf");
      fail();
    } catch (NameAlreadyBoundException expected) {
    }
    // Try to create duplicate subcontext using multi-component name
    try {
      gemfireContext.createSubcontext("env/datasource");
      fail();
    } catch (NameAlreadyBoundException expected) {
    }
  }
Tests inability to create duplicate subcontexts.
geode-core/src/test/java/org/apache/geode/internal/jndi/ContextJUnitTest.java