### Question:
CommandLineParamParser { public static CommandLineParamParser parse(String... args) { Map<String, String> params = new HashMap<>(); for (int i = 0; i < args.length; i += 2) { String key = args[i]; String value = i < args.length - 1 ? args[i + 1] : null; if (!key.startsWith("-")) { printErrorAndExit("key '" + key + "' must start with -"); } params.put(key.substring(1), value); } return new CommandLineParamParser(params); }  static CommandLineParamParser parse(String... args); String value(String key); String valueOr(String key, String defaultValue); List<String> listValue(String key); String requiredValue(String key, String npeMessage); boolean booleanValue(String key); boolean contains(String key);  }### Answer:
@Test void parse() { CommandLineParamParser params = CommandLineParamParser.parse("-r", "/home/repo", "-d", "/home/repo/dest", "-e", "dev6", "-s", "s1,s2", "-q"); assertEquals("/home/repo", params.value("r")); assertEquals("/home/repo/dest", params.value("d")); assertEquals("dev6", params.value("e")); assertEquals(asList("s1", "s2"), params.listValue("s")); assertEquals(emptyList(), params.listValue("empty")); }