public SubnetGroup withSubnets(Subnet... subnets) {
        if (this.subnets == null) {
            setSubnets(new java.util.ArrayList<Subnet>(subnets.length));
        }
        for (Subnet ele : subnets) {
            this.subnets.add(ele);
        }
        return this;
    }
<p>
A list of subnets associated with the subnet group.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setSubnets(java.util.Collection)} or {@link #withSubnets(java.util.Collection)} if you want to override
the existing values.
</p>

@param subnets
       A list of subnets associated with the subnet group.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-memorydb/src/main/java/com/amazonaws/services/memorydb/model/SubnetGroup.java