@Override
	public ProgramGene<A> newInstance() {
		final var random = RandomRegistry.random();

		Op<A> operation = value();
		if (isLeaf()) {
			operation = _terminals.get(random.nextInt(_terminals.length()));
		} else {
			final ISeq<Op<A>> operations = _operations.stream()
				.filter(op -> op.arity() == value().arity())
				.collect(ISeq.toISeq());

			if (operations.length() > 1) {
				operation = operations.get(random.nextInt(operations.length()));
			}
		}

		return newInstance(operation);
	}
Creates a new {@link TreeNode} from this program gene.

@since 5.0

@return a new tree node value build from this program gene
jenetics.prog/src/main/java/io/jenetics/prog/ProgramGene.java