### Question:
DataServiceServlet extends ApiServlet { public BeanConverter getConverterForRequest(HttpServletRequest servletRequest) { String formatString = null; BeanConverter converter = null; String contentType = null; try { formatString = servletRequest.getParameter(FORMAT_PARAM); } catch (Throwable t) { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Unexpected error : format param is null " + t.toString()); } } try { contentType = servletRequest.getContentType(); } catch (Throwable t) { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Unexpected error : content type is null " + t.toString()); } } if (contentType != null) { if (ContentTypes.ALLOWED_JSON_CONTENT_TYPES.contains(contentType)) { converter = jsonConverter; } else if (ContentTypes.ALLOWED_ATOM_CONTENT_TYPES.contains(contentType)) { converter = atomConverter; } else if (ContentTypes.ALLOWED_XML_CONTENT_TYPES.contains(contentType)) { converter = xmlConverter; } else if (formatString == null) { converter = jsonConverter; } } else if (formatString != null) { if (formatString.equals(ATOM_FORMAT)) { converter = atomConverter; } else if (formatString.equals(XML_FORMAT)) { converter = xmlConverter; } else { converter = jsonConverter; } } else { converter = jsonConverter; } return converter; }  BeanConverter getConverterForRequest(HttpServletRequest servletRequest); static final Set<String> ALLOWED_CONTENT_TYPES; }### Answer:
@Test public void testGetConverterForRequest() throws Exception { assertConverter(atomConverter, "atom"); assertConverter(xmlConverter, "xml"); assertConverter(jsonConverter, ""); assertConverter(jsonConverter, null); assertConverter(jsonConverter, "ahhhh!"); }