ContentData extends CandlepinDTO implements ContentInfo { public boolean addModifiedProductId(String productId) { if (productId == null) { throw new IllegalArgumentException("productId is null"); } if (this.modifiedProductIds == null) { this.modifiedProductIds = new HashSet<>(); } return this.modifiedProductIds.add(productId); } ContentData();  ContentData(String id, String name, String type, String label, String vendor);  ContentData(ContentData source);  ContentData(Content source); String getUuid(); ContentData setUuid(String uuid); String getId(); ContentData setId(String id); String getType(); ContentData setType(String type); String getLabel(); ContentData setLabel(String label); String getName(); ContentData setName(String name); String getVendor(); ContentData setVendor(String vendor); String getContentUrl(); ContentData setContentUrl(String contentUrl); String getRequiredTags(); ContentData setRequiredTags(String requiredTags); @JsonProperty("releaseVer") String getReleaseVersion(); @JsonProperty("releaseVer") ContentData setReleaseVersion(String releaseVer); String getGpgUrl(); ContentData setGpgUrl(String gpgUrl); Long getMetadataExpiration(); ContentData setMetadataExpiration(Long metadataExpire); Collection<String> getModifiedProductIds(); @Override Collection<String> getRequiredProductIds(); boolean addModifiedProductId(String productId); boolean removeModifiedProductId(String productId); ContentData setModifiedProductIds(Collection<String> modifiedProductIds); ContentData setRequiredProductIds(Collection<String> requiredProductIds); String getArches(); ContentData setArches(String arches); @XmlTransient Boolean isLocked(); ContentData setLocked(Boolean locked); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone(); ContentData populate(ContentData source); ContentData populate(Content source); static final long serialVersionUID; }
@Test public void testAddModifiedProductId() { ContentData dto = new ContentData(); Collection<String> pids = dto.getModifiedProductIds(); assertNull(pids); boolean output = dto.addModifiedProductId("1"); pids = dto.getModifiedProductIds(); assertTrue(output); assertNotNull(pids); assertTrue(Util.collectionsAreEqual(Arrays.asList("1"), pids)); output = dto.addModifiedProductId("2"); pids = dto.getModifiedProductIds(); assertTrue(output); assertNotNull(pids); assertTrue(Util.collectionsAreEqual(Arrays.asList("1", "2"), pids)); output = dto.addModifiedProductId("1"); pids = dto.getModifiedProductIds(); assertFalse(output); assertNotNull(pids); assertTrue(Util.collectionsAreEqual(Arrays.asList("1", "2"), pids)); }