private <T> T doAsUser(UserGroupInformation ugi, Callable<T> task) throws Exception {
    return ugi.doAs(new PrivilegedExceptionAction<T>() {
      @Override
      public T run() throws Exception {
        return task.call();
      }
    });
  }
Test class to verify that the HBase superuser can override quotas.
hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSuperUserQuotaPermissions.java