### Question:
AssetResponseHttpMessageConverter implements HttpMessageConverter<AssetResponse> { @Override public void write(AssetResponse assetResponse, @Nullable MediaType mediaType, HttpOutputMessage httpOutputMessage) throws IOException { Asset asset = assetResponse.getAsset(); AssetMetaData metaData = asset.getMetaData(); httpOutputMessage.getHeaders() .setContentType(MediaType.parseMediaType(metaData.getContentType())); httpOutputMessage.getHeaders() .setAccept(MediaType.parseMediaTypes(metaData.getContentType())); OutputStream outputStream = httpOutputMessage.getBody(); outputStream.write(asset.getData()); outputStream.close(); }  @Override boolean canRead(Class<?> aClass, @Nullable MediaType mediaType); @Override boolean canWrite(Class<?> aClass, @Nullable MediaType mediaType); @Override List<MediaType> getSupportedMediaTypes(); @Override AssetResponse read(Class<? extends AssetResponse> aClass,
			HttpInputMessage httpInputMessage); @Override void write(AssetResponse assetResponse, @Nullable MediaType mediaType,
			HttpOutputMessage httpOutputMessage);  }### Answer:
@Test public void shouldSucceedWrite() throws IOException { AssetResponse assetResponse = new AssetResponse(asset); MockHttpOutputMessage outputMessage = new MockHttpOutputMessage(); conv.write(assetResponse, MediaType.TEXT_PLAIN, outputMessage); assertEquals(asset.getMetaData().getContentType(), outputMessage.getHeaders().getContentType().toString()); assertTrue(outputMessage.getHeaders().getAccept().contains(MediaType.TEXT_PLAIN)); assertArrayEquals(asset.getData(), outputMessage.getBodyAsBytes()); }