### Question:
ArgumentParser { public void parse(String... arguments) { int i = 0; while (i < arguments.length) { String flag = arguments[i]; try { if (shortFlags.containsKey(flag)) { shortFlags.get(flag).parse(arguments[++i]); } else if (longFlags.containsKey(flag)) { longFlags.get(flag).parse(arguments[++i]); } else if ("-h".equals(flag) || "--help".equals(flag)) { printUsage(); Runtime.getRuntime().exit(0); } else { throw new IllegalArgumentException("Unknown argument: " + flag); } } catch (Exception e) { printUsageAndExit("%s: %s", e.getClass().getName(), e.getMessage()); } i++; } } ArgumentParser(String runnerClass, String runnerDescription); void parse(String... arguments); void printUsage(); void printUsageAndExit(String errorMessage, Object... formatObjects); int getNumberOfTrees(); int getSampleSize(); int getWindowSize(); double getLambda(); int getShingleSize(); boolean getShingleCyclic(); String getDelimiter(); boolean getHeaderRow(); int getRandomSeed(); static final String ARCHIVE_NAME; }### Answer:
@Test public void testParse() { parser.parse("--number-of-trees", "222", "--sample-size", "123", "--window-size", "50", "--shingle-size", "4", "--shingle-cyclic", "true", "--delimiter", "\t", "--header-row", "true"); assertEquals(222, parser.getNumberOfTrees()); assertEquals(123, parser.getSampleSize()); assertEquals(50, parser.getWindowSize()); assertEquals(0.02, parser.getLambda()); assertEquals(4, parser.getShingleSize()); assertTrue(parser.getShingleCyclic()); assertEquals("\t", parser.getDelimiter()); assertTrue(parser.getHeaderRow()); }