// ----------------------------------------------------------------------
 // SelectClusterMember():
 //
 // Select a potential member (an individual in the front Fl) and associate
 // it with the reference point.
 //
 // Check the last two paragraphs in Section IV-E in the original paper.
 // ----------------------------------------------------------------------
 S SelectClusterMember(ReferencePoint<S> rp) {
   S chosen = null;
   if (rp.HasPotentialMember()) {
     if (rp.MemberSize() == 0) // currently has no member
     {
       chosen = rp.FindClosestMember();
     } else {
       chosen = rp.RandomMember();
     }
   }
   return chosen;
 }
  int FindNicheReferencePoint() {
    // find the minimal cluster size
    int min_size = Integer.MAX_VALUE;
    for (ReferencePoint<S> referencePoint : this.referencePoints)
      min_size = Math.min(min_size, referencePoint.MemberSize());

    // find the reference points with the minimal cluster size Jmin
    List<Integer> min_rps = new ArrayList<>();

    for (int r = 0; r < this.referencePoints.size(); r += 1) {
      if (this.referencePoints.get(r).MemberSize() == min_size) {
        min_rps.add(r);
      }
    }
    // return a random reference point (j-bar)
    return min_rps.get(
        min_rps.size() > 1 ? JMetalRandom.getInstance().nextInt(0, min_rps.size() - 1) : 0);
  }