code: public ReplicationGroup withNodeGroups(NodeGroup... nodeGroups) {
          if (this.nodeGroups == null) {
              setNodeGroups(new com.amazonaws.internal.SdkInternalList<NodeGroup>(nodeGroups.length));
          }
          for (NodeGroup ele : nodeGroups) {
              this.nodeGroups.add(ele);
          }
          return this;
      }
docs: <p>
  A list of node groups in this replication group. For Redis (cluster mode disabled) replication groups, this is a
  single-element list. For Redis (cluster mode enabled) replication groups, the list contains an entry for each
  node group (shard).
  </p>
  <p>
  <b>NOTE:</b> This method appends the values to the existing list (if any). Use
  {@link #setNodeGroups(java.util.Collection)} or {@link #withNodeGroups(java.util.Collection)} if you want to
  override the existing values.
  </p>
  
  @param nodeGroups
  A list of node groups in this replication group. For Redis (cluster mode disabled) replication groups,
  this is a single-element list. For Redis (cluster mode enabled) replication groups, the list contains an
  entry for each node group (shard).
  @return Returns a reference to this object so that method calls can be chained together.