public AgentBootstrapperArgs parse(String... args) {
        AgentBootstrapperArgs result = new AgentBootstrapperArgs();
        try {
            new JCommander(result).parse(args);

            if (result.help) {
                printUsageAndExit(0);
            }

            return result;
        } catch (ParameterException e) {
            stderr.println(e.getMessage());
            printUsageAndExit(1);
        }

        return null;
    }
@Test
    public void shouldDieIfNoArguments() {
        try {
            agentCLI.parse();
            fail("Was expecting an exception!");
        } catch (ExitException e) {
            assertThat(e.getStatus()).isEqualTo(1);
            assertThat(errorStream.toString()).contains("The following option is required: [-serverUrl]");
            assertThat(errorStream.toString()).contains("Usage: java -jar agent-bootstrapper.jar");
        }
    }