@Test
  public void testCreateAndDelete() throws Exception {
    String testName = "testCreateAndDelete";
    String nsName = prefix + "_" + testName;

    // create namespace and verify
    admin.createNamespace(NamespaceDescriptor.create(nsName).build()).join();
    assertEquals(3, admin.listNamespaces().get().size());
    assertEquals(3, admin.listNamespaceDescriptors().get().size());
    // delete namespace and verify
    admin.deleteNamespace(nsName).join();
    assertEquals(2, admin.listNamespaces().get().size());
    assertEquals(2, admin.listNamespaceDescriptors().get().size());
  }
Class to test asynchronous namespace admin operations.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncNamespaceAdminApi.java