@Test
  public void testTruncatePerms() throws Exception {
    try {
      List<UserPermission> existingPerms =
        AccessControlClient.getUserPermissions(systemUserConnection, TEST_TABLE.getNameAsString());
      assertTrue(existingPerms != null);
      assertTrue(existingPerms.size() > 1);
      TEST_UTIL.getAdmin().disableTable(TEST_TABLE);
      TEST_UTIL.truncateTable(TEST_TABLE);
      TEST_UTIL.waitTableAvailable(TEST_TABLE);
      List<UserPermission> perms =
        AccessControlClient.getUserPermissions(systemUserConnection, TEST_TABLE.getNameAsString());
      assertTrue(perms != null);
      assertEquals(existingPerms.size(), perms.size());
    } catch (Throwable e) {
      throw new HBaseIOException(e);
    }
  }
List all user permissions match the given regular expression for namespace and verify each of
them.
@param namespaceRegexWithoutPrefix the regualar expression for namespace, without
                                   NAMESPACE_PREFIX
@param expectedAmount              the expected amount of user permissions returned
@param expectedNamespace           the expected namespace of each user permission returned
@throws HBaseException in the case of any HBase exception when accessing hbase:acl table
hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java