### Question:
GroovyResponseHttpMessageConverter implements HttpMessageConverter<GroovyResponse> { @Override public GroovyResponse read(Class<? extends GroovyResponse> clazz, HttpInputMessage inputMessage) throws IOException { final ByteArrayOutputStream output = new ByteArrayOutputStream(); Streams.copy(inputMessage.getBody(), output); return new GroovyResponse() { @Override public InputStream getInputStream() throws IOException { return new ByteArrayInputStream(output.toByteArray()); } }; }  @Override boolean canRead(Class<?> clazz); @Override boolean canWrite(Class<?> clazz); @Override GroovyResponse read(Class<? extends GroovyResponse> clazz, HttpInputMessage inputMessage); @Override void write(GroovyResponse t, String contentType, HttpOutputMessage outputMessage);  }### Answer:
@Test public void read() throws Exception { MockHttpInputMessage inputMessage = new MockHttpInputMessage("print 'hello'"); GroovyResponse response = converter.read(GroovyResponse.class, inputMessage); assertEquals("print 'hello'", Streams.toString(response.getInputStream())); }