### Question:
ProcessShutdownHandler { public void shutdownProcesses() throws ProcessHandlerException { LOGGER.info("Shutting down all our node processes."); ProcessHandler handler = ProcessHandlerFactory.createInstance(); List<ProcessInfo> processes = handler.potentialProcessToBeKilled(); handler.killProcess(processes); LOGGER.info("Successfully shutdown all processes"); }  void shutdownProcesses();  }### Answer:
@Test public void testShutdownProcesses() throws Exception { String app = SystemUtils.IS_OS_WINDOWS ? "notepad.exe" : "phantomjs"; Process phantom = Runtime.getRuntime().exec(new String[] { app }); ProcessShutdownHandler shutdownHandler = new ProcessShutdownHandler(); shutdownHandler.shutdownProcesses(); phantom.waitFor(); assertTrue(phantom.exitValue() > 0); phantom.destroy(); }