@Test public void ProcessMonitorImpl_is_a_proxy_of_Process() throws Exception { Process process = mock(Process.class, RETURNS_DEEP_STUBS); ProcessCommands commands = mock(ProcessCommands.class, RETURNS_DEEP_STUBS); ProcessCommandsProcessMonitor underTest = new ProcessCommandsProcessMonitor(process, ProcessId.WEB_SERVER, commands); underTest.waitFor(); verify(process).waitFor(); underTest.closeStreams(); verify(process.getErrorStream()).close(); verify(process.getInputStream()).close(); verify(process.getOutputStream()).close(); underTest.destroyForcibly(); verify(process).destroyForcibly(); assertThat(underTest.getInputStream()).isNotNull(); underTest.isAlive(); verify(process).isAlive(); underTest.waitFor(123, TimeUnit.MILLISECONDS); verify(process).waitFor(123, TimeUnit.MILLISECONDS); }