static Icon cloneIcon( Icon icon )
		throws IllegalArgumentException
	{
		Class<? extends Icon> iconClass = icon.getClass();
		try {
			return iconClass.getDeclaredConstructor().newInstance();
		} catch( Exception ex ) {
			throw new IllegalArgumentException( "failed to clone icon '" + iconClass.getName() + "'", ex );
		}
	}
Applies the given value to an annotated field of the given object
or to a property of the given component.
The field must be annotated with {@link Styleable}.
The component property must have public getter and setter methods.

@param obj the object
@param comp the component, or {@code null}
@param key the name of the field
@param value the new value
@return the old value of the field
@throws UnknownStyleException if object does not have an annotated field with given name
@throws IllegalArgumentException if value type does not fit to expected type
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatStylingSupport.java