MapperUtil { public static <T> ToDouble<T> mapShortToDouble(ToShort<T> expression, ShortToDoubleFunction mapper) { return new ToDoubleMapper<T, ToShort<T>, ShortToDoubleFunction>(expression, mapper) { @Override public double applyAsDouble(T object) { return this.mapper.applyAsDouble(this.inner.applyAsShort(object)); } @Override public MapperType mapperType() { return MapperType.SHORT_TO_DOUBLE; } }; } private  MapperUtil(); static ToBoolean<T> mapBoolean(ToBoolean<T> expression, BooleanUnaryOperator mapper); static ToDouble<T> mapBooleanToDouble(ToBoolean<T> expression, BooleanToDoubleFunction mapper); static ToChar<T> mapChar(ToChar<T> expression, CharUnaryOperator mapper); static ToByte<T> mapByte(ToByte<T> expression, ByteUnaryOperator mapper); static ToDouble<T> mapByteToDouble(ToByte<T> expression, ByteToDoubleFunction mapper); static ToShort<T> mapShort(ToShort<T> expression, ShortUnaryOperator mapper); static ToDouble<T> mapShortToDouble(ToShort<T> expression, ShortToDoubleFunction mapper); static ToInt<T> mapInt(ToInt<T> expression, IntUnaryOperator mapper); static ToDouble<T> mapIntToDouble(ToInt<T> expression, IntToDoubleFunction mapper); static ToLong<T> mapLong(ToLong<T> expression, LongUnaryOperator mapper); static ToDouble<T> mapLongToDouble(ToLong<T> expression, LongToDoubleFunction mapper); static ToFloat<T> mapFloat(ToFloat<T> expression, FloatUnaryOperator mapper); static ToDouble<T> mapFloatToDouble(ToFloat<T> expression, FloatToDoubleFunction mapper); static ToDouble<T> mapDouble(ToDouble<T> expression, DoubleUnaryOperator mapper); static ToString<T> mapString(ToString<T> expression, UnaryOperator<String> mapper); static ToEnum<T, E> mapEnum(ToEnum<T, E> expression, UnaryOperator<E> mapper); static ToBigDecimal<T> mapBigDecimal(ToBigDecimal<T> expression, UnaryOperator<BigDecimal> mapper); static ToDouble<T> mapBigDecimalToDouble(ToBigDecimal<T> expression, ToDoubleFunction<BigDecimal> mapper);  }
@Test void mapShortToDouble() { final ToShort<Short> toShort = s -> s; final ToDoubleMapper<Short, ToShort<Short>, ShortToDoubleFunction> toDoubleMapper = (ToDoubleMapper<Short, ToShort<Short>, ShortToDoubleFunction>) MapperUtil.mapShortToDouble(toShort, s -> 1); assertEquals(MapperType.SHORT_TO_DOUBLE, toDoubleMapper.mapperType()); }