public ListPackageVersionsResult withVersions(PackageVersionSummary... versions) {
        if (this.versions == null) {
            setVersions(new java.util.ArrayList<PackageVersionSummary>(versions.length));
        }
        for (PackageVersionSummary ele : versions) {
            this.versions.add(ele);
        }
        return this;
    }
<p>
The returned list of <a
href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageVersionSummary.html"
>PackageVersionSummary</a> objects.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setVersions(java.util.Collection)} or {@link #withVersions(java.util.Collection)} if you want to override
the existing values.
</p>

@param versions
       The returned list of <a
       href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageVersionSummary.html"
       >PackageVersionSummary</a> objects.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-codeartifact/src/main/java/com/amazonaws/services/codeartifact/model/ListPackageVersionsResult.java