MapperUtil { public static <T> ToFloat<T> mapFloat(ToFloat<T> expression, FloatUnaryOperator mapper) { return new ToFloatMapper<T, ToFloat<T>, FloatUnaryOperator>(expression, mapper) { @Override public float applyAsFloat(T object) { return this.mapper.applyAsFloat(this.inner.applyAsFloat(object)); } @Override public MapperType mapperType() { return MapperType.FLOAT_TO_FLOAT; } }; } 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 mapFloat() { final ToFloat<Float> toFloat = f -> f; final ToFloatMapper<Float, ToFloat<Float>, FloatUnaryOperator> toFloatMapper = (ToFloatMapper<Float, ToFloat<Float>, FloatUnaryOperator>) MapperUtil.mapFloat(toFloat, f -> f); assertEquals(MapperType.FLOAT_TO_FLOAT, toFloatMapper.mapperType()); }