### Question:
Config { static String getCliConfigOption(final String... args) throws RunnerException { final Options cliOptions = new Options(); cliOptions.addOption(CONFIG_FILE_OPTION); CommandLineParser parser = new DefaultParser(); try { val cmd = parser.parse(cliOptions, args); return cmd.getOptionValue("config"); } catch (ParseException e) { val error = String.format("%s. Use -c, --config <arg>", e.getMessage()); throw new RunnerException(error); } } private  Config();   }### Answer:
@Test void getCliConfigOption_validOption() { try { String option = Config.getCliConfigOption("-c", "test"); assertEquals("test", option); } catch (RunnerException e) { fail(); } }
@Test void getCliConfigOption_validLongOption() { try { String option = Config.getCliConfigOption("--config", "example"); assertEquals("example", option); } catch (RunnerException e) { fail(); } }
@Test void getCliConfigOption_unknownOption() { try { String option = Config.getCliConfigOption("-a", "test"); } catch (RunnerException e) { assertEquals("Unrecognized option: -a. Use -c, --config <arg>", e.getMessage()); } }
@Test void testGetCliConfigOption_unknownLongOption() { try { Config.getCliConfigOption("--unknown", "example"); fail("expected parse exception"); } catch (RunnerException e) { assertEquals("Unrecognized option: --unknown. Use -c, --config <arg>", e.getMessage()); } }