### Question:
CmdInterface { public static void call(String[] args) { try { Map<String, Object> cliOptions = new HashMap<>(); for (int i = 0; i < args.length; ++i) { String arg = args[i]; processHelp(arg); if (i + 1 >= args.length) continue; if (processDbDirectory(arg, args[i + 1], cliOptions)) continue; if (processDbReset(arg, args[i + 1], cliOptions)) continue; } if (cliOptions.size() > 0) { logger.info("Overriding config file with CLI options: {}", cliOptions); } } catch (Throwable e) { logger.error("Error parsing command line: [{}]", e.getMessage()); System.exit(1); } } private  CmdInterface(); static void call(String[] args);  }### Answer:
@Test public void testCliParseForHelp(){ String[] cmds = new String[]{"--help"}; CmdInterface.call(cmds); }
@Test public void testCliParse(){ System.setProperty(CoreConfig.PROPERTY_DB_DIR, "db-00001"); System.setProperty(CoreConfig.PROPERTY_DB_RESET, "yes"); String[] cmds = new String[]{"-db","db-00002","-reset","no"}; CmdInterface.call(cmds); Assert.assertEquals("db-00002", CoreConfig.getInstance().getConfig().getString(CoreConfig.PROPERTY_DB_DIR)); Assert.assertEquals(false, CoreConfig.getInstance().getConfig().getBoolean(CoreConfig.PROPERTY_DB_RESET)); }