public void checkPermissions() {
   // load and assign a handler
   List<Class<? extends SuperpermsHandler>> providerClazz =
       Arrays.asList(
           BPermissions2Handler.class,
           GroupManagerHandler.class,
           PermissionsExHandler.class,
           PrivilegesHandler.class,
           SimplyPermsHandler.class,
           GenericVaultHandler.class,
           SuperpermsHandler.class);
   for (Class<? extends IPermissionsHandler> providerClass : providerClazz) {
     try {
       IPermissionsHandler provider = providerClass.newInstance();
       if (provider.tryProvider()) {
         this.handler = provider;
         break;
       }
     } catch (Throwable ignored) {
     }
   }
   if (handler == null) {
     handler = new ConfigPermissionsHandler(ess);
   }
   if (useSuperperms && handler instanceof ConfigPermissionsHandler) {
     handler = new SuperpermsHandler();
   }
   // output handler info
   if (handler instanceof GenericVaultHandler) {
     String enabledPermsPlugin = ((GenericVaultHandler) handler).getEnabledPermsPlugin();
     if (enabledPermsPlugin == null) enabledPermsPlugin = "generic";
     ess.getLogger().info("Using Vault based permissions (" + enabledPermsPlugin + ")");
   } else if (handler.getClass() == SuperpermsHandler.class) {
     if (handler.tryProvider()) {
       ess.getLogger()
           .warning(
               "Detected supported permissions plugin "
                   + ((SuperpermsHandler) handler).getEnabledPermsPlugin()
                   + " without Vault installed.");
       ess.getLogger()
           .warning(
               "Features such as chat prefixes/suffixes and group-related functionality will not "
                   + "work until you install Vault.");
     }
     ess.getLogger().info("Using superperms-based permissions.");
   } else if (handler.getClass() == ConfigPermissionsHandler.class) {
     ess.getLogger().info("Using config file enhanced permissions.");
     ess.getLogger().info("Permissions listed in as player-commands will be given to all users.");
   }
 }
 @Override
 public boolean inGroup(final Player base, final String group) {
   final long start = System.nanoTime();
   final boolean result = handler.inGroup(base, group);
   checkPermLag(start, String.format("Checking if %s is in group %s", base.getName(), group));
   return result;
 }
 @Override
 public String getSuffix(final Player base) {
   final long start = System.nanoTime();
   String suffix = handler.getSuffix(base);
   if (suffix == null) {
     suffix = "";
   }
   checkPermLag(start, String.format("Getting suffix for %s", base.getName()));
   return suffix;
 }
 @Override
 public List<String> getGroups(final Player base) {
   final long start = System.nanoTime();
   List<String> groups = handler.getGroups(base);
   if (groups == null || groups.isEmpty()) {
     groups = Collections.singletonList(defaultGroup);
   }
   checkPermLag(start, String.format("Getting groups for %s", base.getName()));
   return Collections.unmodifiableList(groups);
 }
 @Override
 public String getGroup(final Player base) {
   final long start = System.nanoTime();
   String group = handler.getGroup(base);
   if (group == null) {
     group = defaultGroup;
   }
   checkPermLag(start, String.format("Getting group for %s", base.getName()));
   return group;
 }
 @Override
 public boolean hasPermission(final Player base, final String node) {
   return handler.hasPermission(base, node);
 }
 @Override
 public boolean canBuild(final Player base, final String group) {
   return handler.canBuild(base, group);
 }
 public String getName() {
   return handler.getClass().getSimpleName().replace("Provider", "");
 }