AcceptType { public static List<AcceptType> fromContentType(final ContentType contentType) { return Collections.singletonList(new AcceptType( contentType.getType(), contentType.getSubtype(), contentType.getParameters(), 1F)); } private  AcceptType(final String type, final String subtype, final Map<String, String> parameters,
      final Float quality); private  AcceptType(final String type); static List<AcceptType> create(final String acceptTypes); static List<AcceptType> fromContentType(final ContentType contentType); String getType(); String getSubtype(); Map<String, String> getParameters(); String getParameter(final String name); Float getQuality(); @Override String toString(); boolean matches(final ContentType contentType);  }
@Test public void fromContentType() { final List<AcceptType> acceptType = AcceptType.fromContentType(ContentType.APPLICATION_JSON); assertNotNull(acceptType); assertEquals(1, acceptType.size()); assertEquals(ContentType.APPLICATION_JSON.toContentTypeString(), acceptType.get(0).toString()); }