### Question:
RunOptions { public static RunOptions fromCommandLine(CommandLine commandLine) { String tableTypeText = commandLine.getOptionValue("tableType"); int defaultPoolSize = Runtime.getRuntime().availableProcessors(); if (defaultPoolSize < 1) defaultPoolSize = 1; int tablePoolSize = getIntOptionValue(commandLine, "tablePoolSize", defaultPoolSize); if (tablePoolSize < 1) throw new IllegalArgumentException("Please specify a positive integer option value for tablePoolSize"); return new RunOptions( commandLine.getOptionValue("location", "."), commandLine.hasOption("execute"), commandLine.getOptionValue("dbRegex", ".*"), commandLine.getOptionValue("tableRegex", ".*"), tableTypeText == null ? null : TableType.valueOf(tableTypeText), tablePoolSize); } private  RunOptions(String outputDir, boolean execute, String dbRegex, String tableRegex, TableType tableType, int tablePoolSize); static RunOptions fromCommandLine(CommandLine commandLine); String getOutputDir(); boolean isExecute(); String getDbRegex(); String getTableRegex(); TableType getTableType(); int getTablePoolSize(); @Override String toString();  }### Answer:
@Test public void testExceptionIsThrownWhenTablePoolSizeIsNotANumber() throws Exception { expectedEx.expect(IllegalArgumentException.class); expectedEx.expectMessage("Please specify a positive integer option value for tablePoolSize"); String[] args = {"-tablePoolSize", "notANumber"}; RunOptions.fromCommandLine(new GnuParser().parse(createCommandLineOptions(), args)); }
@Test public void testExceptionIsThrownWhenTablePoolSizeIsLessThan1() throws Exception { expectedEx.expect(IllegalArgumentException.class); expectedEx.expectMessage("Please specify a positive integer option value for tablePoolSize"); String[] args = {"-tablePoolSize", "0"}; RunOptions.fromCommandLine(new GnuParser().parse(createCommandLineOptions(), args)); }
@Test public void testExceptionIsThrownWhenTablePoolSizeIsNotInteger() throws Exception { expectedEx.expect(IllegalArgumentException.class); expectedEx.expectMessage("Please specify a positive integer option value for tablePoolSize"); String[] args = {"-tablePoolSize", "0.5"}; RunOptions.fromCommandLine(new GnuParser().parse(createCommandLineOptions(), args)); }