@Test public void isValid() { final AnyGene<Integer> gene = AnyGene.of( () -> RandomRegistry.random().nextInt(1000), i -> i < 100 ); for (int i = 0; i < 5000; ++i) { final AnyGene<Integer> g = gene.newInstance(); Assert.assertEquals(g.isValid(), g.allele() < 100); Assert.assertTrue(g.allele() < 1000); Assert.assertTrue(g.allele() >= 0); } }
@Override public boolean isValid() { return _validator.test(_allele); }
AnyGene implements Gene<A, AnyGene<A>> { @Override public boolean isValid() { return _validator.test(_allele); } }
AnyGene implements Gene<A, AnyGene<A>> { @Override public boolean isValid() { return _validator.test(_allele); } private  AnyGene(
		final A allele,
		final Supplier<? extends A> supplier,
		final Predicate<? super A> validator
	); }
AnyGene implements Gene<A, AnyGene<A>> { @Override public boolean isValid() { return _validator.test(_allele); } private  AnyGene(
		final A allele,
		final Supplier<? extends A> supplier,
		final Predicate<? super A> validator
	); @Override A allele(); @Override AnyGene<A> newInstance(); @Override AnyGene<A> newInstance(final A value); @Override boolean isValid(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); static AnyGene<A> of(
		final A allele,
		final Supplier<? extends A> supplier,
		final Predicate<? super A> validator
	); static AnyGene<A> of(
		final A allele,
		final Supplier<? extends A> supplier
	); static AnyGene<A> of(final Supplier<? extends A> supplier); static AnyGene<A> of(
		final Supplier<? extends A> supplier,
		final Predicate<? super A> validator
	); }
AnyGene implements Gene<A, AnyGene<A>> { @Override public boolean isValid() { return _validator.test(_allele); } private  AnyGene(
		final A allele,
		final Supplier<? extends A> supplier,
		final Predicate<? super A> validator
	); @Override A allele(); @Override AnyGene<A> newInstance(); @Override AnyGene<A> newInstance(final A value); @Override boolean isValid(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); static AnyGene<A> of(
		final A allele,
		final Supplier<? extends A> supplier,
		final Predicate<? super A> validator
	); static AnyGene<A> of(
		final A allele,
		final Supplier<? extends A> supplier
	); static AnyGene<A> of(final Supplier<? extends A> supplier); static AnyGene<A> of(
		final Supplier<? extends A> supplier,
		final Predicate<? super A> validator
	);  }