@@ -0,0 +1,1656 @@
+package picocli;%0A%0Aimport org.junit.Test;%0Aimport picocli.CommandLine.Command;%0A%0Aimport java.io.PrintWriter;%0Aimport java.io.StringWriter;%0A%0Aimport static org.junit.Assert.*;%0A%0Apublic class ModelTransformerTest %7B%0A%0A    @Command(name = %22gen-manpage%22, description = %22Generates man pages%22)%0A    static class GenerateManPageCommand implements Runnable %7B%0A        public void run() %7B%7D%0A    %7D%0A%0A    @Command(name = %22mycmd%22,%0A        subcommands = %7BAutoComplete.GenerateCompletion.class, GenerateManPageCommand.class%7D,%0A        modelTransformer = MyTransformer.class,%0A        mixinStandardHelpOptions = true)%0A    static class MyCommand implements Runnable %7B%0A        public void run() %7B%7D%0A    %7D%0A%0A    static class MyTransformer implements CommandLine.IModelTransformer %7B%0A        public CommandLine.Model.CommandSpec transform(CommandLine.Model.CommandSpec commandSpec) %7B%0A            CommandLine gen = commandSpec.removeSubcommand(%22gen-manpage%22);%0A            commandSpec.addSubcommand(%22generate-manpage%22, gen);%0A            return commandSpec;%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void testUsage() %7B%0A        StringWriter sw = new StringWriter();%0A        new CommandLine(new MyCommand()).usage(new PrintWriter(sw));%0A        String expected = String.format(%22%22 +%0A            %22Usage: mycmd %5B-hV%5D %5BCOMMAND%5D%25n%22 +%0A            %22  -h, --help      Show this help message and exit.%25n%22 +%0A            %22  -V, --version   Print version information and exit.%25n%22 +%0A            %22Commands:%25n%22 +%0A            %22  generate-completion  Generate bash/zsh completion script for mycmd.%25n%22 +%0A            %22  generate-manpage     Generates man pages%25n%22);%0A        assertEquals(expected, sw.toString());%0A    %7D%0A%7D%0A

add test demonstrating how to replace subcommand name