@Test public void listShouldIncludeContentTypeArguments(){ ContentType xmlContentType = ContentType.createContentType("application/xml"); ContentType jsonContentType = ContentType.createContentType("application/json"); ContentType rssXmlContentType = ContentType.createContentType("application/rss+xml"); ContentTypes contentTypes = new ContentTypes(xmlContentType, jsonContentType, rssXmlContentType); List<ContentType> list = contentTypes.getListOfContentTypes(); assertThat(list.size(), is(3)); assertTrue(list.contains(xmlContentType)); assertTrue(list.contains(jsonContentType)); assertTrue(list.contains(rssXmlContentType)); }
public List<ContentType> getListOfContentTypes() { return Collections.unmodifiableList(contentTypes); }
ContentTypes { public List<ContentType> getListOfContentTypes() { return Collections.unmodifiableList(contentTypes); } }
ContentTypes { public List<ContentType> getListOfContentTypes() { return Collections.unmodifiableList(contentTypes); } ContentTypes(ContentType... arrayOfContentTypes); }
ContentTypes { public List<ContentType> getListOfContentTypes() { return Collections.unmodifiableList(contentTypes); } ContentTypes(ContentType... arrayOfContentTypes); List<ContentType> getListOfContentTypes(); }
ContentTypes { public List<ContentType> getListOfContentTypes() { return Collections.unmodifiableList(contentTypes); } ContentTypes(ContentType... arrayOfContentTypes); List<ContentType> getListOfContentTypes();  }