public User withGroups(String... groups) {
        if (this.groups == null) {
            setGroups(new java.util.ArrayList<String>(groups.length));
        }
        for (String ele : groups) {
            this.groups.add(ele);
        }
        return this;
    }
<p>
The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric
characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. Does
not apply to RabbitMQ brokers.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setGroups(java.util.Collection)} or {@link #withGroups(java.util.Collection)} if you want to override the
existing values.
</p>

@param groups
       The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only
       alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100
       characters long. Does not apply to RabbitMQ brokers.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-mq/src/main/java/com/amazonaws/services/mq/model/User.java