### Question:
MultiReadHttpServletRequest extends HttpServletRequestWrapper { @Override public ServletInputStream getInputStream() throws IOException { if (readBytes == null) { readInputStream(); } return new CachedServletInputStream(); } MultiReadHttpServletRequest(final HttpServletRequest request); @Override ServletInputStream getInputStream(); @Override BufferedReader getReader();  }### Answer:
@Test public void should_getInputStream_work_when_called_twice() throws Exception { ServletInputStream fakeInputStream = null; try { fakeInputStream = new FakeServletInputStream(); doReturn(fakeInputStream).when(request).getInputStream(); final MultiReadHttpServletRequest multiReadHttpServletRequest = new MultiReadHttpServletRequest(request); final InputStream inputStream = multiReadHttpServletRequest.getInputStream(); Assert.assertEquals("body content", IOUtils.toString(inputStream)); final InputStream inputStream2 = multiReadHttpServletRequest.getInputStream(); Assert.assertEquals("body content", IOUtils.toString(inputStream2)); } finally { if (fakeInputStream != null) { fakeInputStream.close(); } } }