code: @Override
      protected List<BitString> mate(BitString parent1,
                                     BitString parent2,
                                     int numberOfCrossoverPoints,
                                     Random rng)
      {
          if (parent1.getLength() != parent2.getLength())
          {
              throw new IllegalArgumentException("Cannot perform cross-over with different length parents.");
          }
          BitString offspring1 = parent1.clone();
          BitString offspring2 = parent2.clone();
          // Apply as many cross-overs as required.
          for (int i = 0; i < numberOfCrossoverPoints; i++)
          {
              // Cross-over index is always greater than zero and less than
              // the length of the parent so that we always pick a point that
              // will result in a meaningful cross-over.
              int crossoverIndex = (1 + rng.nextInt(parent1.getLength() - 1));
              offspring1.swapSubstring(offspring2, 0, crossoverIndex);
          }
          List<BitString> result = new ArrayList<BitString>(2);
          result.add(offspring1);
          result.add(offspring2);
          return result;
      }
docs: {@inheritDoc}