public MetricV2 withThreshold(ThresholdV2... threshold) {
        if (this.threshold == null) {
            setThreshold(new java.util.ArrayList<ThresholdV2>(threshold.length));
        }
        for (ThresholdV2 ele : threshold) {
            this.threshold.add(ele);
        }
        return this;
    }
<p>
Contains information about the threshold for service level metrics.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setThreshold(java.util.Collection)} or {@link #withThreshold(java.util.Collection)} if you want to
override the existing values.
</p>

@param threshold
       Contains information about the threshold for service level metrics.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-connect/src/main/java/com/amazonaws/services/connect/model/MetricV2.java