types/src/main/java/com/google/common/html/types/SafeHtmlBuilder.java
public SafeHtmlBuilder setIcon(SafeUrl value) {
    if (!ICON_SAFE_URL_ELEMENT_WHITELIST.contains(elementName)) {
      throw new IllegalArgumentException(
          "Attribute \"icon\" with a SafeUrl value can only be used "
              + "by one of the following elements: "
              + ICON_SAFE_URL_ELEMENT_WHITELIST);
    }
    return setAttribute("icon", value.getSafeUrlString());
  }
public SafeHtmlBuilder setIcon(SafeUrl value) {
    if (!ICON_SAFE_URL_ELEMENT_WHITELIST.contains(elementName)) {
      throw new IllegalArgumentException(
          "Attribute \"icon\" with a SafeUrl value can only be used "
              + "by one of the following elements: "
              + ICON_SAFE_URL_ELEMENT_WHITELIST);
    }
    return setAttribute("icon", value.getSafeUrlString());
  }
Sets the {@code icon} attribute for this element.

<p>The attribute {@code icon} with a {@code SafeUrl} value is allowed on these elements:

<ul>
<li>{@code menuitem}
</ul>

@throws IllegalArgumentException if the {@code icon} attribute with a {@code SafeUrl} value is
not allowed on this element