/*
 * Java Genetic Algorithm Library (@__identifier__@).
 * Copyright (c) @__year__@ Franz Wilhelmstötter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Author:
 *    Franz Wilhelmstötter (franz.wilhelmstoetter@gmx.at)
 */
package org.jenetics;

import org.testng.annotations.Test;

import org.jenetics.util.Factory;
import org.jenetics.util.RandomRegistry;

/**
 * @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
 */
@Test
public class AnyGeneTest extends GeneTester<AnyGene<Integer>> {

	@Override
	protected Factory<AnyGene<Integer>> factory() {
		return () -> AnyGene.of(RandomRegistry.getRandom()::nextInt);
	}

}

@@ -757,16 +757,42 @@
 etics;%0A%0A
+import org.testng.Assert;%0A
 import o
@@ -819,16 +819,16 @@
 s.Test;%0A
-
 %0Aimport 
@@ -990,14 +990,8 @@
  */%0A
-@Test%0A
 publ
@@ -1111,16 +1111,16 @@
 ory() %7B%0A
-
 %09%09return
@@ -1179,10 +1179,285 @@
 t);%0A%09%7D%0A%0A
+%09@Test%0A%09public void allowNullAlleles() %7B%0A%09%09final Integer allele = null;%0A%09%09final AnyGene%3CInteger%3E gene = AnyGene%0A%09%09%09.of(allele, () -%3E null);%0A%0A%09%09Assert.assertNull(gene.getAllele());%0A%09%09for (int i = 0; i %3C 10; ++i) %7B%0A%09%09%09Assert.assertNull(gene.newInstance().getAllele());%0A%09%09%7D%0A%09%7D%0A%0A
 %7D%0A

Add test for allowed 'null' alleles.