public MqttHeaders withUserProperties(UserProperty... userProperties) {
        if (this.userProperties == null) {
            setUserProperties(new java.util.ArrayList<UserProperty>(userProperties.length));
        }
        for (UserProperty ele : userProperties) {
            this.userProperties.add(ele);
        }
        return this;
    }
<p>
An array of key-value pairs that you define in the MQTT5 header.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setUserProperties(java.util.Collection)} or {@link #withUserProperties(java.util.Collection)} if you want
to override the existing values.
</p>

@param userProperties
       An array of key-value pairs that you define in the MQTT5 header.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/MqttHeaders.java