// Path: MetaHeuristics4Java/src/main/java/de/mh4j/solver/genetic/Couple.java
// public class Couple {
// 	private final Genome parent1;
// 	private final Genome parent2;
// 
// 	public Couple(Genome parent1, Genome parent2) {
// 		this.parent1 = parent1;
// 		this.parent2 = parent2;
// 	}
// 
// 	public Genome getParent1() {
// 		return parent1;
// 	}
// 
// 	public Genome getParent2() {
// 		return parent2;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "<" + parent1.toString() + ", " + parent2.toString() + ">";
// 	}
// }
// 
// Path: MetaHeuristics4Java/src/main/java/de/mh4j/solver/genetic/Genome.java
// public abstract class Genome implements Solution<Genome>, Comparable<Genome> {
// 
//     private final Random random;
// 
//     public final static int NO_BIRTH_GENERATION_ASSOCIATED = -1;
// 
//     private int birthGeneration;
// 
//     /**
//      * TODO write javadoc<br>
//      */
//     public Genome() {
//         random = RNGGenerator.createRandomNumberGenerator();
//         birthGeneration = NO_BIRTH_GENERATION_ASSOCIATED;
//     }
// 
//     /**
//      * Returns the general Fitness of this genome. The better a genome is the
//      * higher should this value be.
//      */
//     public abstract int getFitness();
// 
//     /**
//      * The costs of a genome are the opposite of its fitness. The better a
//      * genome is, the higher is its fitness and the lower will the costs be.
//      * 
//      * @return the negated return value of <code>getFitness()</code>
//      * @see #getFitness()
//      */
//     @Override
//     public int getCosts() {
//         return getFitness();
//     }
// 
//     /**
//      * TODO write javadoc
//      */
//     public int getBirthGeneration() {
//         return birthGeneration;
//     }
// 
//     /**
//      * TODO write javadoc
//      */
//     public void setBirthGeneration(int birthGeneration) {
//         this.birthGeneration = birthGeneration;
//     }
// 
//     /**
//      * Compares this genome to another genome depending on the return values of
//      * {@link #isBetterThan(Genome)} and {@link #equals(Object)}.
//      * 
//      * @param otherGenome
//      *            the other genome which is compared to this genome
//      * @return <code>Comparable.GREATER</code> if this genome is better<br>
//      *         <code>Comparable.LOWER</code> if this genome is worse<br>
//      *         <code>Comparable.EQUAL</code> if both genomes are equal<br>
//      *         or some value randomly chosen between
//      *         <code>Comparable.LOWER</code> and <code>Comparable.GREATER</code>
//      *         if <code>this.isBetterThan(otherGenome)</code> and
//      *         <code>otherGenome.isBetterThan(this)</code> and
//      *         <code>this.equals(otherGenome)</code> all return
//      *         <code>false</code>
//      * @see Comparable
//      */
//     @Override
//     public int compareTo(Genome otherGenome) {
// 
//         if (this.isBetterThan(otherGenome)) {
//             return Comparable.GREATER;
//         }
//         else if (otherGenome.isBetterThan(this)) {
//             return Comparable.LOWER;
//         }
//         else if (this.equals(otherGenome)) {
//             return Comparable.EQUAL;
//         }
//         else {
//             if (random.nextBoolean()) {
//                 return Comparable.LOWER;
//             }
//             else {
//                 return Comparable.GREATER;
//             }
//         }
//     }
// }


import java.util.Collection;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import de.mh4j.solver.genetic.Couple;
import de.mh4j.solver.genetic.Genome;

package de.mh4j.solver.genetic.matingselection;




public class StochasticUniversalSamplingSelectorTest extends MatingSelectorTestCase {

    @Override
    @BeforeMethod
    public void setUp() {
        super.setUp();
    }

    @Test
    public void testSelect() throws Exception {
        int numberOfPairs = 4;

// Path: MetaHeuristics4Java/src/main/java/de/mh4j/solver/genetic/Couple.java
// public class Couple {
// 	private final Genome parent1;
// 	private final Genome parent2;
// 
// 	public Couple(Genome parent1, Genome parent2) {
// 		this.parent1 = parent1;
// 		this.parent2 = parent2;
// 	}
// 
// 	public Genome getParent1() {
// 		return parent1;
// 	}
// 
// 	public Genome getParent2() {
// 		return parent2;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return "<" + parent1.toString() + ", " + parent2.toString() + ">";
// 	}
// }
// 
// Path: MetaHeuristics4Java/src/main/java/de/mh4j/solver/genetic/Genome.java
// public abstract class Genome implements Solution<Genome>, Comparable<Genome> {
// 
//     private final Random random;
// 
//     public final static int NO_BIRTH_GENERATION_ASSOCIATED = -1;
// 
//     private int birthGeneration;
// 
//     /**
//      * TODO write javadoc<br>
//      */
//     public Genome() {
//         random = RNGGenerator.createRandomNumberGenerator();
//         birthGeneration = NO_BIRTH_GENERATION_ASSOCIATED;
//     }
// 
//     /**
//      * Returns the general Fitness of this genome. The better a genome is the
//      * higher should this value be.
//      */
//     public abstract int getFitness();
// 
//     /**
//      * The costs of a genome are the opposite of its fitness. The better a
//      * genome is, the higher is its fitness and the lower will the costs be.
//      * 
//      * @return the negated return value of <code>getFitness()</code>
//      * @see #getFitness()
//      */
//     @Override
//     public int getCosts() {
//         return getFitness();
//     }
// 
//     /**
//      * TODO write javadoc
//      */
//     public int getBirthGeneration() {
//         return birthGeneration;
//     }
// 
//     /**
//      * TODO write javadoc
//      */
//     public void setBirthGeneration(int birthGeneration) {
//         this.birthGeneration = birthGeneration;
//     }
// 
//     /**
//      * Compares this genome to another genome depending on the return values of
//      * {@link #isBetterThan(Genome)} and {@link #equals(Object)}.
//      * 
//      * @param otherGenome
//      *            the other genome which is compared to this genome
//      * @return <code>Comparable.GREATER</code> if this genome is better<br>
//      *         <code>Comparable.LOWER</code> if this genome is worse<br>
//      *         <code>Comparable.EQUAL</code> if both genomes are equal<br>
//      *         or some value randomly chosen between
//      *         <code>Comparable.LOWER</code> and <code>Comparable.GREATER</code>
//      *         if <code>this.isBetterThan(otherGenome)</code> and
//      *         <code>otherGenome.isBetterThan(this)</code> and
//      *         <code>this.equals(otherGenome)</code> all return
//      *         <code>false</code>
//      * @see Comparable
//      */
//     @Override
//     public int compareTo(Genome otherGenome) {
// 
//         if (this.isBetterThan(otherGenome)) {
//             return Comparable.GREATER;
//         }
//         else if (otherGenome.isBetterThan(this)) {
//             return Comparable.LOWER;
//         }
//         else if (this.equals(otherGenome)) {
//             return Comparable.EQUAL;
//         }
//         else {
//             if (random.nextBoolean()) {
//                 return Comparable.LOWER;
//             }
//             else {
//                 return Comparable.GREATER;
//             }
//         }
//     }
// }


// Path: MetaHeuristics4Java/src/test/java/de/mh4j/solver/genetic/matingselection/StochasticUniversalSamplingSelectorTest.java
import java.util.Collection;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import de.mh4j.solver.genetic.Couple;
import de.mh4j.solver.genetic.Genome;

package de.mh4j.solver.genetic.matingselection;




public class StochasticUniversalSamplingSelectorTest extends MatingSelectorTestCase {

    @Override
    @BeforeMethod
    public void setUp() {
        super.setUp();
    }

    @Test
    public void testSelect() throws Exception {
        int numberOfPairs = 4;

        MatingSelector<Genome> selector = new StochasticUniversalSamplingSelector<>();
