### Question:
SwapMutation extends SwapMutator<EnumGene<WildcardGene>, Double> implements MutationOperator { public SwapMutation(final double mutationPropability) { this.mutationPropability = mutationPropability; } SwapMutation(final double mutationPropability); @Override Classifier mutate(final Classifier classifier); public double mutationPropability; }### Answer:
@Test public void testSwapMutation() { final MutationOperator mutation = new SwapMutation(1); final WildcardGene[] inital = new WildcardGene[] { TRUE, FALSE, FALSE, FALSE, FALSE }; final WildcardChromosome origin = WildcardChromosome.of(inital); final WildcardChromosome initChromosome = WildcardChromosome.of(inital); final Classifier classifier = new Classifier("rule1", initChromosome, 0, Parameters.init()); final String beforeMutation = classifier.getCondition().toCanonicalString(); log.info("{} vs {}", beforeMutation, WildcardChromosome.of(inital).toCanonicalString()); mutation.mutate(classifier); log.info("{} vs {}", beforeMutation, classifier.getCondition().toCanonicalString()); Assertions.assertThat(classifier.getCondition().countWildcards()) .isEqualByComparingTo(classifier.getCondition().countWildcards()); Assertions.assertThat(origin.matches(classifier.getCondition())).isFalse(); }