public static InvertibleCodec<Integer, IntegerGene>
	ofScalar(final IntRange domain) {
		requireNonNull(domain);

		return InvertibleCodec.of(
			Genotype.of(IntegerChromosome.of(domain)),
			gt -> gt.chromosome().gene().allele(),
			val -> Genotype.of(IntegerChromosome.of(IntegerGene.of(val, domain)))
		);
	}
Return a scalar {@link InvertibleCodec} for the given range.

@param domain the domain of the returned {@code Codec}
@return a new scalar {@code Codec} with the given domain.
@throws NullPointerException if the given {@code domain} is {@code null}
jenetics/src/main/java/io/jenetics/engine/Codecs.java