@@ -0,0 +1,1452 @@
+package picocli;%0A%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;%0Aimport picocli.CommandLine.Command;%0A%0Aimport java.util.concurrent.Callable;%0A%0Apublic class Issue787SubclassSubcommandStackOverflow %7B%0A%0A    @Command(mixinStandardHelpOptions = true)%0A    static abstract class AbstractCommand implements Callable%3CInteger%3E %7B%0A        public Integer call() throws Exception %7B%0A            System.out.printf(%22Greetings from %25s%25n%22, getClass().getName());%0A            return 0;%0A        %7D%0A    %7D%0A%0A    @Command(subcommands = %7B Sub1ExtendConcreteCmd.class, Sub2ExtendAbstractCmd.class %7D,%0A            name = %22ami-search%22, aliases = %22search%22)%0A    static class ConcreteCommand extends AbstractCommand %7B%0A    %7D%0A%0A    // will overflow (A)%0A    @Command(name = %22ami-words1%22, aliases = %22words1%22)%0A    static class Sub1ExtendConcreteCmd extends ConcreteCommand %7B%0A    %7D%0A%0A    // no overflow (B)%0A    @Command(name = %22ami-words2%22, aliases = %22words2%22)%0A    static class Sub2ExtendAbstractCmd extends AbstractCommand %7B%0A    %7D%0A%0A    // overflows%0A    @Ignore%0A    @Test%0A    public void testAMISearchSubCommands() %7B%0A        new CommandLine(new ConcreteCommand()).execute(%22ami-words1%22);%0A    %7D%0A%0A    // overflows%0A    @Ignore%0A    @Test%0A    public void testAMIWords1Commands() %7B%0A        new CommandLine(new Sub1ExtendConcreteCmd()).execute();%0A    %7D%0A%0A    // does not overflow%0A    @Test%0A    public void testAMIWords2Commands() %7B%0A        new CommandLine(new Sub2ExtendAbstractCmd()).execute();%0A    %7D%0A%0A%7D%0A

add test for StackOverflowError when subclassing subcommands