@@ -0,0 +1,1750 @@
+package picocli;%0A%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;%0Aimport picocli.CommandLine.ArgGroup;%0Aimport picocli.CommandLine.Command;%0Aimport picocli.CommandLine.Option;%0A%0Aimport static org.junit.Assert.*;%0A%0Apublic class Issue1536ResetOptionInGroup %7B%0A    static class Args %7B%0A        @Option(names = %7B%22-opt1%22%7D) int opt1;%0A        @Option(names = %7B%22-opt2%22%7D) int opt2;%0A%0A        @Override%0A        public String toString() %7B%0A            return %22Args%7B%22 +%0A                %22opt1=%22 + opt1 +%0A                %22, opt2=%22 + opt2 +%0A                '%7D';%0A        %7D%0A    %7D%0A%0A    @Command(name = %22cmd%22)%0A     static class Cmd implements Runnable %7B%0A        @ArgGroup(exclusive = false) Args args;%0A%0A        @Option(names = %7B%22-opt3%22%7D) int opt3;%0A%0A        public void run() %7B%0A            System.out.println(args+%22, opt3=%22+opt3);%0A        %7D%0A    %7D%0A%0A//    enter cmd; the output is null, opt3=0 (group opt1/opt2 unset)%0A//    enter cmd -opt1=33 -opt2=44 -opt3=55; the output is Args%7Bopt1=33, opt2=44%7D, opt3=55%0A//    enter cmd (without options) again; the output is Args%7Bopt1=33, opt2=44%7D, opt3=0 (opt3 resetted correctly, the argument-group kept)%0A    @Ignore(%22see https://github.com/remkop/picocli/issues/1536%22)%0A    @Test%0A    public void testIssue1536() %7B%0A        Cmd main = new Cmd();%0A        CommandLine cmdLine = new CommandLine(main);%0A%0A        cmdLine.parseArgs();%0A        assertEquals(0, main.opt3);%0A        assertEquals(null, main.args);%0A%0A        cmdLine.parseArgs(%22-opt1=33 -opt2=44 -opt3=55%22.split(%22 %22));%0A        assertEquals(55, main.opt3);%0A        assertNotNull(main.args);%0A        assertEquals(33, main.args.opt1);%0A        assertEquals(44, main.args.opt2);%0A%0A        cmdLine.parseArgs();%0A        assertEquals(0, main.opt3);%0A        assertEquals(null, main.args);%0A    %7D%0A%0A%7D%0A

Add failing test