@Test public void mean() { final long min = -Integer.MAX_VALUE; final long max = Integer.MAX_VALUE; final LongGene template = LongGene.of(min, max); for (int i = 1; i < 500; ++i) { final LongGene a = template.newInstance(i - 50L); final LongGene b = template.newInstance((i - 100L) *3); final LongGene 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 LongGene mean(final LongGene that) { return LongGene.of(_allele + (that._allele - _allele)/2, _min, _max); }
LongGene implements
		NumericGene<Long, LongGene>,
		Mean<LongGene>,
		Comparable<LongGene>,
		Serializable { @Override public LongGene mean(final LongGene that) { return LongGene.of(_allele + (that._allele - _allele)/2, _min, _max); } }
LongGene implements
		NumericGene<Long, LongGene>,
		Mean<LongGene>,
		Comparable<LongGene>,
		Serializable { @Override public LongGene mean(final LongGene that) { return LongGene.of(_allele + (that._allele - _allele)/2, _min, _max); } private  LongGene(final long allele, final long min, final long max); }
LongGene implements
		NumericGene<Long, LongGene>,
		Mean<LongGene>,
		Comparable<LongGene>,
		Serializable { @Override public LongGene mean(final LongGene that) { return LongGene.of(_allele + (that._allele - _allele)/2, _min, _max); } private  LongGene(final long allele, final long min, final long max); @Override Long allele(); @Override Long min(); @Override Long max(); LongRange 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 LongGene other); @Override LongGene mean(final LongGene that); LongGene newInstance(final long allele); @Override LongGene newInstance(final Long allele); @Override LongGene newInstance(final Number allele); @Override LongGene newInstance(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); static LongGene of(final long allele, final long min, final long max); static LongGene of(final long allele, final LongRange range); static LongGene of(final long min, final long max); static LongGene of(final LongRange range); }
LongGene implements
		NumericGene<Long, LongGene>,
		Mean<LongGene>,
		Comparable<LongGene>,
		Serializable { @Override public LongGene mean(final LongGene that) { return LongGene.of(_allele + (that._allele - _allele)/2, _min, _max); } private  LongGene(final long allele, final long min, final long max); @Override Long allele(); @Override Long min(); @Override Long max(); LongRange 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 LongGene other); @Override LongGene mean(final LongGene that); LongGene newInstance(final long allele); @Override LongGene newInstance(final Long allele); @Override LongGene newInstance(final Number allele); @Override LongGene newInstance(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); static LongGene of(final long allele, final long min, final long max); static LongGene of(final long allele, final LongRange range); static LongGene of(final long min, final long max); static LongGene of(final LongRange range);  }