### Question:
Main { public static void main(String[] args) { logger.info("Running CLI with arguments {}", Arrays.toString(args)); try { InputStream inputStream = Main.class.getResourceAsStream("/cli-specification.txt"); String doc = IOUtils.toString(inputStream); Docopt docopt = new Docopt(doc); Map<String, Object> opts = docopt .withVersion("bromium 0.1") .withHelp(true) .withExit(true) .parse(args); Map<String, Supplier<Command>> commandToHandler = getCommands(); String selectedCommand = commandToHandler .keySet() .stream() .filter(command -> opts.get(command).equals(true)) .findAny() .get(); injector = Guice.createInjector(new DefaultModule(selectedCommand, opts)); commandToHandler.get(selectedCommand).get().run(); } catch (IOException e) { logger.error(e.getMessage(), e); } }  static void main(String[] args);  }### Answer:
@Test public void doesNotDoAnythingIfExceptionIsThrown() throws IOException { PowerMockito.mockStatic(IOUtils.class); PowerMockito.when(IOUtils.toString(any(InputStream.class))).thenThrow(new IOException("Exception while reading spec")); String[] args = { "update", "-a", "configuration.json" }; Main.main(args); }