public static FlinkServerConfiguration parseArgs(String[] args) {
    FlinkServerConfiguration configuration = new FlinkServerConfiguration();
    CmdLineParser parser = new CmdLineParser(configuration);
    try {
      parser.parseArgument(args);
    } catch (CmdLineException e) {
      LOG.error("Unable to parse command line arguments.", e);
      printUsage(parser);
      throw new IllegalArgumentException("Unable to parse command line arguments.", e);
    }
    return configuration;
  }
@Test
  public void testConfigurationFromArgs() {
    FlinkJobServerDriver.FlinkServerConfiguration config =
        FlinkJobServerDriver.parseArgs(
            new String[] {
              "--job-host=test",
              "--job-port",
              "42",
              "--artifact-port",
              "43",
              "--expansion-port",
              "44",
              "--flink-master=jobmanager",
              "--clean-artifacts-per-job=false",
            });
    assertThat(config.getHost(), is("test"));
    assertThat(config.getPort(), is(42));
    assertThat(config.getArtifactPort(), is(43));
    assertThat(config.getExpansionPort(), is(44));
    assertThat(config.getFlinkMaster(), is("jobmanager"));
    assertThat(config.isCleanArtifactsPerJob(), is(false));
  }