class PurgeTask extends BukkitRunnable {

    @Override
    public void run() {
        if (toPurge.isEmpty()) {
            //everything was removed
            finish();
            return;
        }

        Set<OfflinePlayer> playerPortion = new HashSet<>(INTERVAL_CHECK);
        Set<String> namePortion = new HashSet<>(INTERVAL_CHECK);
        for (int i = 0; i < INTERVAL_CHECK; i++) {
            int nextPosition = (currentPage * INTERVAL_CHECK) + i;
            if (offlinePlayers.length <= nextPosition) {
                //no more offline players on this page
                break;
            }

            OfflinePlayer offlinePlayer = offlinePlayers[nextPosition];
            if (offlinePlayer.getName() != null && toPurge.remove(offlinePlayer.getName().toLowerCase())) {
                try {
                    permissionsManager.loadUserData(offlinePlayer.getUniqueId());
                } catch (NoSuchMethodError e) {
                    permissionsManager.loadUserData(offlinePlayer.getName());
                }
                if (!permissionsManager.hasPermissionOffline(offlinePlayer, PlayerStatePermission.BYPASS_PURGE)) {
                    playerPortion.add(offlinePlayer);
                    namePortion.add(offlinePlayer.getName());
                }
            }
        }

        if (!toPurge.isEmpty() && playerPortion.isEmpty()) {
            ConsoleLogger.info("Finished lookup of offlinePlayers. Begin looking purging player names only");

            //we went through all offlineplayers but there are still names remaining
            for (String name : toPurge) {
                if (!permissionsManager.hasPermissionOffline(name, PlayerStatePermission.BYPASS_PURGE)) {
                    namePortion.add(name);
                }
            }
            toPurge.clear();
        }

        currentPage++;
        purgeService.executePurge(playerPortion, namePortion);
        if (currentPage % 20 == 0) {
            int completed = totalPurgeCount - toPurge.size();
            sendMessage("[AuthMe] Purge progress " + completed + '/' + totalPurgeCount);
        }
    }

      PurgeTask(PurgeService service, PermissionsManager permissionsManager, CommandSender sender,
              Set<String> toPurge, OfflinePlayer[] offlinePlayers);

}