private void clearContext(Context context) throws NamingException {
    for (NamingEnumeration e = context.listBindings(""); e.hasMoreElements();) {
      Binding binding = (Binding) e.nextElement();
      if (binding.getObject() instanceof Context) {
        clearContext((Context) binding.getObject());
      }
      context.unbind(binding.getName());
    }
  }
Removes all entries from the specified context, including subcontexts.

@param context context to clear
geode-core/src/test/java/org/apache/geode/internal/jndi/ContextJUnitTest.java