IntFlipMutation extends MutationOperation { public void doOperation(List<Individual> operands) { for (Individual operand : operands) { this.doOperation(operand); } } IntFlipMutation(double prob,RandomNumberGenerator rng);  IntFlipMutation(RandomNumberGenerator rng, Properties p); void doOperation(List<Individual> operands); void doOperation(final Individual operand);  }
@Test public void testDoOperation_Individual() { System.out.println("*IntFlipMutationTest: doOperation"); GEIndividual operand = IndividualMaker.makeIndividual(); int[] chromosome = {0,2,Integer.MIN_VALUE,Integer.MAX_VALUE,0,2}; int[] expected = {0, 2, Integer.MIN_VALUE, Integer.MAX_VALUE,1520873195,1277901399}; GEChromosome geChromosome = (GEChromosome)operand.getGenotype().get(0); geChromosome.setAll(chromosome); IntFlipMutation instance = new IntFlipMutation(0.5, new MersenneTwisterFast(0)); instance.doOperation(operand); JUnitHelper.checkArrays(expected, geChromosome.data); GEIndividualTest.testInvalidated(operand); operand = IndividualMaker.makeIndividual(); geChromosome = null; try { instance.doOperation(operand); } catch(NullPointerException e) { assertTrue(true); } GEIndividualTest.testInvalidated(operand); }