ProductData extends CandlepinDTO implements ProductInfo { public Collection<ProductContentData> getProductContent() { return this.content != null ? this.content.values() : null; } ProductData();  ProductData(String id, String name);  ProductData(ProductData source);  ProductData(Product source); String getUuid(); ProductData setUuid(String uuid); String getId(); ProductData setId(String id); String getName(); ProductData setName(String name); Long getMultiplier(); ProductData setMultiplier(Long multiplier); Map<String, String> getAttributes(); @XmlTransient String getAttributeValue(String key); @XmlTransient boolean hasAttribute(String key); ProductData setAttribute(String key, String value); boolean removeAttribute(String key); ProductData setAttributes(Map<String, String> attributes); Collection<ProductContentData> getProductContent(); ProductContentData getProductContent(String contentId); boolean hasContent(String contentId); boolean addProductContent(ProductContentData contentData); boolean addProductContent(ProductContent productContent); boolean addContent(ContentData contentData, boolean enabled); boolean addContent(Content content, boolean enabled); boolean removeContent(String contentId); boolean removeContent(Content content); boolean removeContent(ContentData contentData); boolean removeProductContent(ProductContent content); boolean removeProductContent(ProductContentData contentData); ProductData setProductContent(Collection<ProductContentData> content); Collection<String> getDependentProductIds(); boolean addDependentProductId(String productId); boolean removeDependentProductId(String productId); ProductData setDependentProductIds(Collection<String> dependentProductIds); Collection<Branding> getBranding(); ProductData setBranding(Collection<Branding> branding); boolean addBranding(Branding branding); boolean removeBranding(Branding branding); String getHref(); ProductData setHref(String href); @XmlTransient Boolean isLocked(); ProductData setLocked(Boolean locked); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone(); ProductData populate(ProductData source); ProductData populate(Product source); static final long serialVersionUID; }
@Test public void testGetProductContent() { ProductData dto = new ProductData(); ContentData[] content = new ContentData[] { new ContentData("c1", "content-1", "test_type", "test_label-1", "test_vendor-1"), new ContentData("c2", "content-2", "test_type", "test_label-2", "test_vendor-2"), new ContentData("c3", "content-3", "test_type", "test_label-3", "test_vendor-3"), }; ProductContentData pcdata1 = new ProductContentData(content[0], true); ProductContentData pcdata2 = new ProductContentData(content[1], false); ProductContentData pcdata3 = new ProductContentData(content[2], true); ProductContentData output = dto.getProductContent("c1"); assertNull(output); dto.setProductContent(Arrays.asList(pcdata1, pcdata2, pcdata3)); output = dto.getProductContent("c1"); assertEquals(pcdata1, output); output = dto.getProductContent("c3"); assertEquals(pcdata3, output); output = dto.getProductContent("c4"); assertNull(output); }