CompositeAlterer extends AbstractAlterer<G, C> { static <T extends Gene<?, T>, C extends Comparable<? super C>> CompositeAlterer<T, C> join( final Alterer<T, C> a1, final Alterer<T, C> a2 ) { return CompositeAlterer.of(a1, a2); } CompositeAlterer(final Seq<Alterer<G, C>> alterers); @Override AltererResult<G, C> alter(
		final Seq<Phenotype<G, C>> population,
		final long generation
	); @Override String toString();  }
@Test public void join() { CompositeAlterer<DoubleGene, Double> alterer = CompositeAlterer .<DoubleGene, Double>join( new Mutator<>(), new SwapMutator<>() ); Assert.assertEquals(alterer.alterers().length(), 2); Assert.assertTrue(alterer.alterers().get(0) instanceof Mutator); Assert.assertTrue(alterer.alterers().get(1) instanceof SwapMutator); alterer = CompositeAlterer.join(alterer, new MeanAlterer<>()); Assert.assertEquals(alterer.alterers().length(), 3); Assert.assertTrue(alterer.alterers().get(0) instanceof Mutator); Assert.assertTrue(alterer.alterers().get(1) instanceof SwapMutator); Assert.assertTrue(alterer.alterers().get(2) instanceof MeanAlterer); alterer = CompositeAlterer.of( new MeanAlterer<>(), new SwapMutator<>(), alterer, new SwapMutator<>() ); Assert.assertEquals(alterer.alterers().length(), 6); }