public TestAuthorizationRequest withPolicyNamesToAdd(String... policyNamesToAdd) {
        if (this.policyNamesToAdd == null) {
            setPolicyNamesToAdd(new java.util.ArrayList<String>(policyNamesToAdd.length));
        }
        for (String ele : policyNamesToAdd) {
            this.policyNamesToAdd.add(ele);
        }
        return this;
    }
<p>
When testing custom authorization, the policies specified here are treated as if they are attached to the
principal being authorized.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setPolicyNamesToAdd(java.util.Collection)} or {@link #withPolicyNamesToAdd(java.util.Collection)} if you
want to override the existing values.
</p>

@param policyNamesToAdd
       When testing custom authorization, the policies specified here are treated as if they are attached to the
       principal being authorized.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/TestAuthorizationRequest.java