public ModifyImageAttributeRequest withUserGroups(java.util.Collection<String> userGroups) {
        setUserGroups(userGroups);
        return this;
    }
<p>
The user groups. This parameter can be used only when the <code>Attribute</code> parameter is
<code>launchPermission</code>.
</p>

@param userGroups
       The user groups. This parameter can be used only when the <code>Attribute</code> parameter is
       <code>launchPermission</code>.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/ModifyImageAttributeRequest.java