public JobFlowInstancesConfig withInstanceGroups(InstanceGroupConfig... instanceGroups) {
        if (this.instanceGroups == null) {
            setInstanceGroups(new com.amazonaws.internal.SdkInternalList<InstanceGroupConfig>(instanceGroups.length));
        }
        for (InstanceGroupConfig ele : instanceGroups) {
            this.instanceGroups.add(ele);
        }
        return this;
    }
public JobFlowInstancesConfig withInstanceGroups ( InstanceGroupConfig ... instanceGroups ) { if ( this . instanceGroups == null ) { setInstanceGroups ( new com . amazonaws . internal . SdkInternalList < InstanceGroupConfig > ( instanceGroups . length ) ) ; } for ( InstanceGroupConfig ele : instanceGroups ) { this . instanceGroups . add ( ele ) ; } return this ; }
<p>
Configuration for the instance groups in a cluster.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setInstanceGroups(java.util.Collection)} or {@link #withInstanceGroups(java.util.Collection)} if you want
to override the existing values.
</p>

@param instanceGroups
Configuration for the instance groups in a cluster.
@return Returns a reference to this object so that method calls can be chained together.