ConsumerDTO extends TimestampedCandlepinDTO<ConsumerDTO> { public boolean removeInstalledProduct(String productId) { if (StringUtils.isEmpty(productId)) { throw new IllegalArgumentException("productId is null or empty"); } if (this.installedProducts != null) { for (String dto : this.installedProducts) { if (dto.contentEquals(productId)) { return this.installedProducts.remove(dto); } } } return false; } ConsumerDTO();  ConsumerDTO(ConsumerDTO source); @HateoasInclude String getUuid(); ConsumerDTO setUuid(String uuid); String getUsername(); ConsumerDTO setUsername(String username); String getServiceLevel(); ConsumerDTO setServiceLevel(String serviceLevel); String getRole(); ConsumerDTO setRole(String role); String getUsage(); ConsumerDTO setUsage(String usage); Set<String> getAddOns(); ConsumerDTO setAddOns(Set<String> addOns); OwnerDTO getOwner(); ConsumerDTO setOwner(OwnerDTO owner); @HateoasArrayExclude Map<String, String> getFacts(); ConsumerDTO setFacts(Map<String, String> facts); ConsumerDTO setFact(String key, String value); @JsonSerialize(contentUsing = InstalledProductIdWrapSerializer.class) Set<String> getInstalledProducts(); @JsonDeserialize(contentUsing = InstalledProductIdWrapDeserializer.class) ConsumerDTO setInstalledProducts(Set<String> installedProducts); boolean addInstalledProduct(String installedProduct); boolean removeInstalledProduct(String productId); @JsonSerialize(contentUsing = CapabilityNameWrapSerializer.class) Set<String> getCapabilities(); @JsonDeserialize(contentUsing = CapabilityNameWrapDeserializer.class) ConsumerDTO setCapabilities(Set<String> capabilities); ConsumerTypeDTO getType(); ConsumerDTO setType(ConsumerTypeDTO type); String getFact(String factKey); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override ConsumerDTO clone(); @Override ConsumerDTO populate(ConsumerDTO source); static final long serialVersionUID; }
@Test(expected = IllegalArgumentException.class) public void testRemoveNullFromInstalledProducts() throws Exception { ConsumerDTO dto = new ConsumerDTO(); dto.removeInstalledProduct(null); }