/** * Retrieves the composition of two mappings, i.e., that mapping that results from applying the {@link * Mapping#get(Object)} method consecutively. * * @param <D> * domain class of the first (and resulting) mapping. * @param <I> * intermediate object class, range class of the first and domain class of the second mapping. * @param <R> * range class of the second (and resulting) mapping. * @param first * first mapping. * @param second * second mapping. * * @return the composed mapping. */ public static <D, I, R> Mapping<D, R> compose(Mapping<D, ? extends I> first, Mapping<? super I, R> second) { return new MappingComposition<D, I, R>(first, second); }