CommandLineIO { public CommandLineResultHandler getResultHandler() { return this.resultHandler; } CommandLineIO(ByteArrayOutputStream outputStream, ByteArrayOutputStream errorStream);  CommandLineIO(ByteArrayOutputStream outputStream, ByteArrayOutputStream errorStream, CommandLineResultHandler resultHandler); List<String> getOutputStringList(); List<String> getErrorStringList(); ByteArrayOutputStream getOutputStream(); ByteArrayOutputStream getErrorStream(); CommandLineResultHandler getResultHandler();  }
@Test public void canCreateAsynchronousInstance() throws Exception { ExecuteWatchdog mockWatchDog = mock(ExecuteWatchdog.class); CommandLineResultHandler resultHandler = new CommandLineResultHandler(mockWatchDog); commandLineIO = new CommandLineIO(new ByteArrayOutputStream(), new ByteArrayOutputStream(), resultHandler); assertThat(commandLineIO.getResultHandler(), equalTo(resultHandler)); }