public ForwardAction withTargetGroups(WeightedTargetGroup... targetGroups) {
        if (this.targetGroups == null) {
            setTargetGroups(new java.util.ArrayList<WeightedTargetGroup>(targetGroups.length));
        }
        for (WeightedTargetGroup ele : targetGroups) {
            this.targetGroups.add(ele);
        }
        return this;
    }
<p>
The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward actions,
you can assign a weight that controls the prioritization and selection of each target group. This means that
requests are distributed to individual target groups based on their weights. For example, if two target groups
have the same weight, each target group receives half of the traffic.
</p>
<p>
The default value is 1. This means that if only one target group is provided, there is no need to set the weight;
100% of the traffic goes to that target group.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setTargetGroups(java.util.Collection)} or {@link #withTargetGroups(java.util.Collection)} if you want to
override the existing values.
</p>

@param targetGroups
       The target groups. Traffic matching the rule is forwarded to the specified target groups. With forward
       actions, you can assign a weight that controls the prioritization and selection of each target group. This
       means that requests are distributed to individual target groups based on their weights. For example, if
       two target groups have the same weight, each target group receives half of the traffic.</p>
       <p>
       The default value is 1. This means that if only one target group is provided, there is no need to set the
       weight; 100% of the traffic goes to that target group.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-vpclattice/src/main/java/com/amazonaws/services/vpclattice/model/ForwardAction.java