code: public <S extends Object> void migrate(List<List<EvaluatedCandidate<S>>> islandPopulations, int migrantCount, Random rng)
      {
          List<EvaluatedCandidate<S>> migrants = new ArrayList<EvaluatedCandidate<S>>(migrantCount * islandPopulations.size());
          for (List<EvaluatedCandidate<S>> island : islandPopulations)
          {
              Collections.shuffle(island, rng);
              for (int i = 0; i < migrantCount; i++)
              {
                  migrants.add(island.remove(island.size() - 1));
              }
          }
          Collections.shuffle(migrants);
          Iterator<EvaluatedCandidate<S>> iterator = migrants.iterator();
          for (List<EvaluatedCandidate<S>> island : islandPopulations)
          {
              for (int i = 0; i < migrantCount; i++)
              {
                  island.add(iterator.next());
              }
          }
      }
docs: Migrates a fixed number of candidates away from each island.  Which individuals are migrated is determined
  randomly and which islands they move to is also random.  If the migration count is greater than one, it is
  possible (probable) that migrants from the same island will be moved to different islands.  It is also possible
  that when a migrant's destination is randomly chosen, it gets sent back to the island that it came from.
  @param islandPopulations A list of the populations of each island.
  @param migrantCount The number of (randomly selected) individuals to be moved on from
  each island.
  @param rng A source of randomness.
  @param <S> The type of entity being evolved.