ProductDTO extends TimestampedCandlepinDTO<ProductDTO> implements ProductInfo { @JsonIgnore public boolean removeAttribute(String key) { if (key == null) { throw new IllegalArgumentException("key is null"); } if (this.attributes != null && this.attributes.containsKey(key)) { this.attributes.remove(key); return true; } return false; } ProductDTO();  ProductDTO(ProductDTO source); String getUuid(); ProductDTO setUuid(String uuid); Long getMultiplier(); ProductDTO setMultiplier(Long multiplier); String getId(); ProductDTO setId(String id); String getName(); ProductDTO setName(String name); Map<String, String> getAttributes(); @JsonIgnore String getAttributeValue(String key); @JsonIgnore boolean hasAttribute(String key); @JsonIgnore ProductDTO setAttribute(String key, String value); @JsonIgnore boolean removeAttribute(String key); ProductDTO setAttributes(Map<String, String> attributes); Collection<ProductContentDTO> getProductContent(); @JsonIgnore ProductContentDTO getProductContent(String contentId); @JsonIgnore ContentDTO getContent(String contentId); @JsonIgnore boolean hasContent(String contentId); @JsonIgnore boolean addProductContent(ProductContentDTO dto); @JsonIgnore boolean addContent(ContentDTO dto, boolean enabled); @JsonIgnore boolean removeContent(String contentId); @JsonIgnore boolean removeContent(ContentDTO dto); @JsonIgnore boolean removeProductContent(ProductContentDTO dto); ProductDTO setProductContent(Collection<ProductContentDTO> productContent); Collection<String> getDependentProductIds(); @JsonIgnore boolean addDependentProductId(String productId); @JsonIgnore boolean removeDependentProductId(String productId); ProductDTO setDependentProductIds(Collection<String> dependentProductIds); @JsonIgnore @Override Set<BrandingDTO> getBranding(); @JsonIgnore ProductDTO setBranding(Set<BrandingDTO> branding); @JsonIgnore boolean addBranding(BrandingDTO branding); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override ProductDTO clone(); ProductDTO populate(ProductDTO source); static final long serialVersionUID; }
@Test public void testRemoveAttributeWithNullAttribute() { ProductDTO dto = new ProductDTO(); assertThrows(IllegalArgumentException.class, () -> dto.removeAttribute(null)); }