### Question:
OutputCapturerInstaller { public void install(OutputCapturer capturer) { outErr.setOut(capturer.out()); outErr.setErr(capturer.err()); } OutputCapturerInstaller(OutErr outErr); void install(OutputCapturer capturer);  }### Answer:
@Test public void replaces_stdout_with_the_captured_stream() { installer.install(capturer); assertThat(outErr.out(), is(capturer.out())); }
@Test public void replaces_stderr_with_the_captured_stream() { installer.install(capturer); assertThat(outErr.err(), is(capturer.err())); }