code: public java.util.List<String> getNodeGroupsToRetain() {
          if (nodeGroupsToRetain == null) {
              nodeGroupsToRetain = new com.amazonaws.internal.SdkInternalList<String>();
          }
          return nodeGroupsToRetain;
      }
docs: <p>
  If the value of <code>NodeGroupCount</code> is less than the current number of node groups (shards), the
  <code>NodeGroupsToRemove</code> or <code>NodeGroupsToRetain</code> is a required list of node group ids to remove
  from or retain in the cluster.
  </p>
  <p>
  ElastiCache for Redis will attempt to remove all node groups except those listed by
  <code>NodeGroupsToRetain</code> from the cluster.
  </p>
  
  @return If the value of <code>NodeGroupCount</code> is less than the current number of node groups (shards), the
  <code>NodeGroupsToRemove</code> or <code>NodeGroupsToRetain</code> is a required list of node group ids
  to remove from or retain in the cluster.</p>
  <p>
  ElastiCache for Redis will attempt to remove all node groups except those listed by
  <code>NodeGroupsToRetain</code> from the cluster.