public ListEntitiesForPolicyResult withPolicyGroups(PolicyGroup... policyGroups) {
        if (this.policyGroups == null) {
            setPolicyGroups(new com.amazonaws.internal.SdkInternalList<PolicyGroup>(policyGroups.length));
        }
        for (PolicyGroup ele : policyGroups) {
            this.policyGroups.add(ele);
        }
        return this;
    }
<p>
A list of IAM groups that the policy is attached to.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setPolicyGroups(java.util.Collection)} or {@link #withPolicyGroups(java.util.Collection)} if you want to
override the existing values.
</p>

@param policyGroups
       A list of IAM groups that the policy is attached to.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/model/ListEntitiesForPolicyResult.java