@Test
public void checkSupport() throws Exception {

  ContentNegotiator.checkSupport(ContentType.JSON, null, RepresentationType.ENTITY);
  ContentNegotiator.checkSupport(ContentType.TEXT_PLAIN, null, RepresentationType.VALUE);
  try {
    ContentNegotiator.checkSupport(ContentType.APPLICATION_SVG_XML, null, RepresentationType.ENTITY);
    fail("Exception expected.");
  } catch (final ContentNegotiatorException e) {
    assertEquals(ContentNegotiatorException.MessageKeys.UNSUPPORTED_CONTENT_TYPE, e.getMessageKey());
  }
  ContentNegotiator.checkSupport(ContentType.create("a/b"), createCustomContentTypeSupport("a/b"),
      RepresentationType.ENTITY);
  ContentNegotiator.checkSupport(ContentType.create(ContentType.create("a/b"), "c", "d"),
      createCustomContentTypeSupport("a/b"),
      RepresentationType.ENTITY);
  try {
    ContentNegotiator.checkSupport(ContentType.create("a/b"), createCustomContentTypeSupport("a/b;c=d"),
        RepresentationType.ENTITY);
    fail("Exception expected.");
  } catch (final ContentNegotiatorException e) {
    assertEquals(ContentNegotiatorException.MessageKeys.UNSUPPORTED_CONTENT_TYPE, e.getMessageKey());
  }
}