### Question:
ContentTypeUtils { public static boolean containsContentType(String contentType, String[] allowedContentTypes) { if (allowedContentTypes == null) { return false; } for (int i = 0; i < allowedContentTypes.length; i++) { if (allowedContentTypes[i].contains(contentType)) { return true; } } return false; }  static boolean containsContentType(String contentType, String[] allowedContentTypes); static String chooseWriterContentType(String contentTypeListString, 
            String[] htmlContentTypes, String[] xhtmlContentTypes); static String[] splitContentTypeListString(String contentTypeListString); static String getContentTypeFromAcceptHeader(FacesContext context); static String[] getSupportedContentTypes(); static boolean isXHTMLContentType(String contentType); static final String HTML_CONTENT_TYPE; static final String TEXT_ANY_CONTENT_TYPE; static final String ANY_CONTENT_TYPE; static final String[] HTML_ALLOWED_CONTENT_TYPES; static final String XHTML_CONTENT_TYPE; static final String APPLICATION_XML_CONTENT_TYPE; static final String TEXT_XML_CONTENT_TYPE; static final String[] XHTML_ALLOWED_CONTENT_TYPES; static final String[] AJAX_XHTML_ALLOWED_CONTENT_TYPES; static final String DEFAULT_CHAR_ENCODING; }### Answer:
@Test public void testContainsContentType() throws Exception { Assert.assertTrue(ContentTypeUtils.containsContentType( ContentTypeUtils.HTML_CONTENT_TYPE, ContentTypeUtils.HTML_ALLOWED_CONTENT_TYPES)); Assert.assertTrue(ContentTypeUtils.containsContentType( ContentTypeUtils.ANY_CONTENT_TYPE, ContentTypeUtils.HTML_ALLOWED_CONTENT_TYPES)); Assert.assertTrue(ContentTypeUtils.containsContentType( ContentTypeUtils.TEXT_ANY_CONTENT_TYPE, ContentTypeUtils.HTML_ALLOWED_CONTENT_TYPES)); Assert.assertTrue(ContentTypeUtils.containsContentType( ContentTypeUtils.XHTML_CONTENT_TYPE, ContentTypeUtils.XHTML_ALLOWED_CONTENT_TYPES)); Assert.assertTrue(ContentTypeUtils.containsContentType( ContentTypeUtils.APPLICATION_XML_CONTENT_TYPE, ContentTypeUtils.XHTML_ALLOWED_CONTENT_TYPES)); Assert.assertTrue(ContentTypeUtils.containsContentType( ContentTypeUtils.TEXT_XML_CONTENT_TYPE, ContentTypeUtils.XHTML_ALLOWED_CONTENT_TYPES)); }