@Test public void mean() { final int min = -Integer.MAX_VALUE; final int max = Integer.MAX_VALUE; final IntegerGene template = IntegerGene.of(min, max); for (int i = 1; i < 500; ++i) { final IntegerGene a = template.newInstance(i - 50L); final IntegerGene b = template.newInstance((i - 100L) *3); final IntegerGene c = a.mean(b); assertEquals(a.min().longValue(), min); assertEquals(a.max().longValue(), max); assertEquals(b.min().longValue(), min); assertEquals(b.max().longValue(), max); assertEquals(c.min().longValue(), min); assertEquals(c.max().longValue(), max); assertEquals(c.allele().longValue(), ((i - 50) + ((i - 100)*3))/2); } }
@Override public IntegerGene mean(final IntegerGene that) { return IntegerGene.of(_allele + (that._allele - _allele)/2, _min, _max); }
IntegerGene implements
		NumericGene<Integer, IntegerGene>,
		Mean<IntegerGene>,
		Comparable<IntegerGene>,
		Serializable { @Override public IntegerGene mean(final IntegerGene that) { return IntegerGene.of(_allele + (that._allele - _allele)/2, _min, _max); } }
IntegerGene implements
		NumericGene<Integer, IntegerGene>,
		Mean<IntegerGene>,
		Comparable<IntegerGene>,
		Serializable { @Override public IntegerGene mean(final IntegerGene that) { return IntegerGene.of(_allele + (that._allele - _allele)/2, _min, _max); } private  IntegerGene(final int allele, final int min, final int max); }
IntegerGene implements
		NumericGene<Integer, IntegerGene>,
		Mean<IntegerGene>,
		Comparable<IntegerGene>,
		Serializable { @Override public IntegerGene mean(final IntegerGene that) { return IntegerGene.of(_allele + (that._allele - _allele)/2, _min, _max); } private  IntegerGene(final int allele, final int min, final int max); @Override Integer allele(); @Override Integer min(); @Override Integer max(); IntRange range(); @Override byte byteValue(); @Override short shortValue(); @Override int intValue(); @Override long longValue(); @Override float floatValue(); @Override double doubleValue(); @Override boolean isValid(); @Override int compareTo(final IntegerGene other); @Override IntegerGene mean(final IntegerGene that); IntegerGene newInstance(final int allele); @Override IntegerGene newInstance(final Integer allele); @Override IntegerGene newInstance(final Number allele); @Override IntegerGene newInstance(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); static IntegerGene of(final int allele, final int min, final int max); static IntegerGene of(final int allele, final IntRange range); static IntegerGene of(final int min, final int max); static IntegerGene of(final IntRange range); }
IntegerGene implements
		NumericGene<Integer, IntegerGene>,
		Mean<IntegerGene>,
		Comparable<IntegerGene>,
		Serializable { @Override public IntegerGene mean(final IntegerGene that) { return IntegerGene.of(_allele + (that._allele - _allele)/2, _min, _max); } private  IntegerGene(final int allele, final int min, final int max); @Override Integer allele(); @Override Integer min(); @Override Integer max(); IntRange range(); @Override byte byteValue(); @Override short shortValue(); @Override int intValue(); @Override long longValue(); @Override float floatValue(); @Override double doubleValue(); @Override boolean isValid(); @Override int compareTo(final IntegerGene other); @Override IntegerGene mean(final IntegerGene that); IntegerGene newInstance(final int allele); @Override IntegerGene newInstance(final Integer allele); @Override IntegerGene newInstance(final Number allele); @Override IntegerGene newInstance(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); static IntegerGene of(final int allele, final int min, final int max); static IntegerGene of(final int allele, final IntRange range); static IntegerGene of(final int min, final int max); static IntegerGene of(final IntRange range);  }