### Question:
SolrQueryResponseWriterFactory { public static QueryResponseWriter generateResponseWriter(String wt) throws SolrServerException { QueryResponseWriter writer = null; if(wt == null || wt.trim().equals("") || wt.equals(XML)) { writer = new XMLResponseWriter(); } else if(wt.equals(JSON)) { writer = new JSONResponseWriter(); } else if(wt.equals(PYTHON)) { writer = new PythonResponseWriter(); } else if(wt.equals(RUBY)) { writer = new RubyResponseWriter(); } else if(wt.equals(PHP)) { writer = new PHPResponseWriter(); } else if(wt.equals(PHPS)) { writer = new PHPSerializedResponseWriter(); } else if(wt.equals(CSV)) { writer = new CSVResponseWriter(); } else { throw new SolrServerException("Metacat doesn't support this response format "+wt); } return writer; }  static QueryResponseWriter generateResponseWriter(String wt); static String getContentType(String wt); static final String XML; static final String JSON; static final String PYTHON; static final String RUBY; static final String PHP; static final String PHPS; static final String VELOCITY; static final String CSV; }### Answer:
@Test public void testGenerateResponseWriter() throws Exception { QueryResponseWriter writer = SolrQueryResponseWriterFactory.generateResponseWriter(null); assertTrue(writer instanceof XMLResponseWriter); writer = SolrQueryResponseWriterFactory.generateResponseWriter(SolrQueryResponseWriterFactory.XML); assertTrue(writer instanceof XMLResponseWriter); writer = SolrQueryResponseWriterFactory.generateResponseWriter(SolrQueryResponseWriterFactory.JSON); assertTrue(writer instanceof JSONResponseWriter); try { writer = SolrQueryResponseWriterFactory.generateResponseWriter("other"); assertTrue("There is not wirter for name - other", false); } catch (Exception e ) { assertTrue("There is not wirter for name - other", true); } }