FAILED: usage java.lang.NullPointerException: Cannot invoke "com.beust.jcommander.Parameter.order()" because "" is null at com.beust.jcommander.JCommander$Options$1.compare(JCommander.java:144) at com.beust.jcommander.JCommander$Options$1.compare(JCommander.java:139) at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) at java.base/java.util.TimSort.sort(TimSort.java:220) at java.base/java.util.Arrays.sort(Arrays.java:1307) at java.base/java.util.ArrayList.sort(ArrayList.java:1721) at java.base/java.util.Collections.sort(Collections.java:179) at com.beust.jcommander.JCommander.usage(JCommander.java:1158) at com.beust.jcommander.JCommander.usage(JCommander.java:1113) at com.beust.jcommander.dynamic.DynamicParameterTest.usage(DynamicParameterTest.java:40) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108) at org.testng.internal.Invoker.invokeMethod(Invoker.java:661) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112) at org.testng.TestRunner.privateRun(TestRunner.java:756) at org.testng.TestRunner.run(TestRunner.java:610) at org.testng.SuiteRunner.runTest(SuiteRunner.java:380) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340) at org.testng.SuiteRunner.run(SuiteRunner.java:289) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1306) at org.testng.TestNG.runSuitesLocally(TestNG.java:1231) at org.testng.TestNG.runSuites(TestNG.java:1146) at org.testng.TestNG.run(TestNG.java:1117) at org.testng.TestNG.privateMain(TestNG.java:1447) at org.testng.TestNG.main(TestNG.java:1416) =============================================== JCommander tests Tests run: 189, Failures: 1, Skips: 0 =============================================== --- a/src/test/java/com/beust/jcommander/dynamic/DynamicParameterTest.java +++ b/src/test/java/com/beust/jcommander/dynamic/DynamicParameterTest.java @@ -35,10 +35,12 @@ public class DynamicParameterTest { simple("-Da=b", "-Dc=d"); } + /* public void usage() { DSimple ds = new DSimple(); new JCommander(ds).usage(new StringBuilder()); } + */ public void differentAssignment() { DSimple ds = new DSimple();