@@ -0,0 +1,1968 @@
+package com.beust.jcommander;%0A%0Aimport org.testng.Assert;%0Aimport org.testng.annotations.Test;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0A/**%0A * %3Cp%3ETest that parameter order specified via order attributes is respected%3C/p%3E%0A */%0Apublic class ParameterOrderTest %7B%0A%0A  private static class ManualOrder1 %7B%0A    @Parameter(order=1, names = %22--arg_b%22)%0A    public boolean isB;%0A    @Parameter(order=0, names = %22--arg_a%22)%0A    public boolean isA;%0A    @Parameter(order=2, names = %22--arg_c%22)%0A    public boolean isC;%0A  %7D%0A%0A  @Test%0A  public void testOrder1() %7B%0A    testOrder(new ManualOrder1(), %22--arg_a%22,%22--arg_b%22,%22--arg_c%22);%0A  %7D%0A%0A  private static class ManualOrder2 %7B%0A    @Parameter(order=1, names = %22--arg_b%22)%0A    public boolean isZ;%0A    @DynamicParameter(order=0, names = %22--arg_a%22)%0A    public Map%3CString,String%3E mapA;%0A    @Parameter(order=2, names = %22--arg_c%22)%0A    public boolean isC;%0A  %7D%0A%0A  @Test%0A  public void testOrder2() %7B%0A    testOrder(new ManualOrder2(), %22--arg_a%22,%22--arg_b%22,%22--arg_c%22);%0A  %7D%0A%0A  private static class ManualOrder3 %7B%0A    @Parameter(order=1, names = %22--arg_b%22)%0A    public boolean isB;%0A    @Parameter(order=0, names = %22--arg_a%22)%0A    public boolean isA;%0A    @Parameter(names = %22--arg_d%22)%0A    public boolean isD;%0A    @Parameter(order=2, names = %22--arg_c%22)%0A    public boolean isC;%0A  %7D%0A%0A  @Test%0A  public void testOrder3() %7B%0A    testOrder(new ManualOrder3(), %22--arg_a%22,%22--arg_b%22,%22--arg_c%22, %22--arg_d%22);%0A  %7D%0A%0A  public void testOrder(Object cmd, String ... expected) %7B%0A    JCommander commander = new JCommander(cmd);%0A%0A    StringBuilder out = new StringBuilder();%0A    commander.getUsageFormatter().usage(out);%0A    String output = out.toString();%0A    List%3CString%3E order = new ArrayList%3C%3E();%0A    for (String line : output.split(%22%5B%5C%5Cn%5C%5Cr%5D+%22)) %7B%0A      String trimmed = line.trim();%0A      if (!trimmed.contains(%22:%22)) %7B%0A        order.add(trimmed);%0A      %7D%0A    %7D%0A    Assert.assertEquals(order, Arrays.asList(expected));%0A  %7D%0A%7D%0A

Add a test for Parameter order usage