* make the outcome predictable (all bits will be flipped).
*/
@Test
public void testSingleBitMutation()
{
BitString original = new BitString("111100101");
EvolutionaryOperator<BitString> mutation = new BitStringMutation(Probability.ONE);
List<BitString> population = Arrays.asList(original);
population = mutation.apply(population, FrameworkTestUtils.getRNG());
BitString mutated = population.get(0);
assert !mutated.equals(original) : "Mutation should be different from original.";
assert mutated.getLength() == 9 : "Mutated bit string changed length.";
int set = mutated.countSetBits();
int unset = mutated.countUnsetBits();
assert set == 5 || set == 7 : "Mutated bit string has wrong number of 1s: " + set;
assert unset == 2 || unset == 4 : "Mutated bit string has wrong number of 0s: " + unset;
}