### Question:
MarmottaHttpUtils { public static ContentType bestContentType(List<ContentType> offeredTypes, List<ContentType> requestedTypes) { for(ContentType requested : requestedTypes) { for(ContentType offered : offeredTypes) { if(requested.matches(offered)) { return offered; } } } for(ContentType requested : requestedTypes) { for(ContentType offered : offeredTypes) { if(requested.matchesSubtype(offered)) { return offered; } } } for(ContentType requested : requestedTypes) { for(ContentType offered : offeredTypes) { if(requested.matchesWildcard(offered)) { return offered; } } } return null; }  static List<ContentType> parseAcceptHeader(String header); static List<ContentType> parseAcceptHeaders(List<String> headers); static List<ContentType> parseStringList(Collection<String> types); static List<ContentType> parseQueryResultFormatList(Collection<? extends QueryResultFormat> types); static ContentType parseContentType(String c); static ContentType bestContentType(List<ContentType> offeredTypes, List<ContentType> requestedTypes); static ContentType performContentNegotiation(String accept, Collection<String> producedContentTypes); static ContentType performContentNegotiation(String accept, List<ContentType> producedContentTypes);  }### Answer:
@Test public void testConentTypeMatching() throws Exception { assertEquals("application/rdf+xml", MarmottaHttpUtils.bestContentType(ImmutableList.of(new ContentType("application", "rdf+xml")), ImmutableList.of(new ContentType("application", "rdf+xml"))).getMime()); assertEquals("application/rdf+xml", MarmottaHttpUtils.bestContentType(ImmutableList.of(new ContentType("application", "rdf+xml")), ImmutableList.of(new ContentType("application", "xml"))).getMime()); assertEquals(null, MarmottaHttpUtils.bestContentType(ImmutableList.of(new ContentType("text", "tutle")), ImmutableList.of(new ContentType("text", "plain")))); }