private static void replaceArgs(List<String> args, int i, Function<String, String> rewrites) {
        String arg = args.get(i).toLowerCase(Locale.ROOT);
        String rewrite = rewrites.apply(arg);
        if (rewrite != null) {
            args.remove(i);
            args.add(i, rewrite);
        }
    }
Applies "convenience" aliases to the given cmd line arguments.

@param args the current args list
@param rewriteLastArgument if the last argument should be rewritten - 
                           this is false when the method is called on tab completions
common/src/main/java/me/lucko/luckperms/common/command/CommandManager.java