@Test public void createApplicationXmlContentTypeShouldReturnSameInstanceWhenDefaultBuiltInInstanceAlreadyExists() { String applicationXmlContentTypeString = "application/xml"; ContentType applicationXmlContentType = ContentType.createContentType(applicationXmlContentTypeString); ContentType otherApplicationXmlContentType = ContentType.createContentType(applicationXmlContentTypeString); assertTrue(applicationXmlContentType == otherApplicationXmlContentType); }
public static ContentType createContentType(String contentTypeString) { ContentType contentType = getDefaultContentType(contentTypeString); if (contentType != null) { return contentType; } return new ContentType(contentTypeString); }
ContentType { public static ContentType createContentType(String contentTypeString) { ContentType contentType = getDefaultContentType(contentTypeString); if (contentType != null) { return contentType; } return new ContentType(contentTypeString); } }
ContentType { public static ContentType createContentType(String contentTypeString) { ContentType contentType = getDefaultContentType(contentTypeString); if (contentType != null) { return contentType; } return new ContentType(contentTypeString); } private  ContentType(String contentTypeString); }
ContentType { public static ContentType createContentType(String contentTypeString) { ContentType contentType = getDefaultContentType(contentTypeString); if (contentType != null) { return contentType; } return new ContentType(contentTypeString); } private  ContentType(String contentTypeString); @Override String toString(); @Override boolean equals(Object object); @Override int hashCode(); static ContentType createContentType(String contentTypeString); }
ContentType { public static ContentType createContentType(String contentTypeString) { ContentType contentType = getDefaultContentType(contentTypeString); if (contentType != null) { return contentType; } return new ContentType(contentTypeString); } private  ContentType(String contentTypeString); @Override String toString(); @Override boolean equals(Object object); @Override int hashCode(); static ContentType createContentType(String contentTypeString); static final ContentType CONTENT_TYPE_APPLICATION_JSON; static final ContentType CONTENT_TYPE_APPLICATION_XML; static final ContentType CONTENT_TYPE_TEXT_JSON; static final ContentType CONTENT_TYPE_TEXT_XML; static final ContentType CONTENT_TYPE_TEXT_PLAIN; }