static <T, G extends Gene<?, G>> Codec<T, G> of(
		final Factory<Genotype<G>> encoding,
		final Function<? super Genotype<G>, ? extends T> decoder
	) {
		requireNonNull(encoding);
		requireNonNull(decoder);

		return new Codec<>() {
			@Override
			public Factory<Genotype<G>> encoding() {
				return encoding;
			}

			@Override
			@SuppressWarnings("unchecked")
			public Function<Genotype<G>, T> decoder() {
				return (Function<Genotype<G>, T>)decoder;
			}
		};
	}
Create a new {@code Codec} object with the given {@code encoding} and
{@code decoder} function.

@param encoding the genotype factory used for creating new
       {@code Genotypes}
@param decoder decoder function, which converts a {@code Genotype} to a
       value in the problem domain
@param <G> the {@code Gene} type
@param <T> the fitness function argument type in the problem domain
@return a new {@code Codec} object with the given parameters
@throws NullPointerException if one of the arguments is {@code null}.
jenetics/src/main/java/io/jenetics/engine/Codec.java