### Question:
SolrQueryResponseTransformer { public InputStream transformResults(SolrParams request, QueryResponse response, String wt) throws SolrServerException, IOException { QueryResponseWriter writer = SolrQueryResponseWriterFactory.generateResponseWriter(wt); Writer results = new StringWriter(); SolrQueryResponse sResponse = new SolrQueryResponse(); sResponse.setAllValues(response.getResponse()); writer.write(results, new LocalSolrQueryRequest(core, request), sResponse); ContentTypeByteArrayInputStream ctbais = new ContentTypeByteArrayInputStream(results.toString().getBytes("UTF-8")); ctbais.setContentType(SolrQueryResponseWriterFactory.getContentType(wt)); return ctbais; } SolrQueryResponseTransformer(SolrCore core); InputStream transformResults(SolrParams request, QueryResponse response, String wt);  }### Answer:
@Test public void testTransformResults() throws Exception { SolrClient solrServer = SolrServerFactory.createSolrServer(); CoreContainer coreContainer = SolrServerFactory.getCoreContainer(); String collectionName = SolrServerFactory.getCollectionName(); SolrQueryResponseTransformer solrTransformer = new SolrQueryResponseTransformer(coreContainer.getCore(collectionName)); InputStream inputStream = null; String wt = "xml"; String queryStr = "q=*:*"; SolrParams query = SolrRequestParsers.parseQueryString(queryStr); QueryResponse response = solrServer.query(query); inputStream = solrTransformer.transformResults(query, response, wt); assertTrue(inputStream != null); }