public Association withTargets(Target... targets) {
        if (this.targets == null) {
            setTargets(new com.amazonaws.internal.SdkInternalList<Target>(targets.length));
        }
        for (Target ele : targets) {
            this.targets.add(ele);
        }
        return this;
    }
<p>
The managed nodes targeted by the request to create an association. You can target all managed nodes in an Amazon
Web Services account by specifying the <code>InstanceIds</code> key with a value of <code>*</code>.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setTargets(java.util.Collection)} or {@link #withTargets(java.util.Collection)} if you want to override
the existing values.
</p>

@param targets
       The managed nodes targeted by the request to create an association. You can target all managed nodes in an
       Amazon Web Services account by specifying the <code>InstanceIds</code> key with a value of <code>*</code>.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/Association.java