MapperUtil { public static <T> ToLong<T> mapLong(ToLong<T> expression, LongUnaryOperator mapper) { return new ToLongMapper<T, ToLong<T>, LongUnaryOperator>(expression, mapper) { @Override public long applyAsLong(T object) { return this.mapper.applyAsLong(this.inner.applyAsLong(object)); } @Override public MapperType mapperType() { return MapperType.LONG_TO_LONG; } }; } 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 mapLong() { final ToLong<Long> toLong = l -> l; final ToLongMapper<Long, ToLong<Long>, LongUnaryOperator> toLongMapper = (ToLongMapper<Long, ToLong<Long>, LongUnaryOperator>) MapperUtil.mapLong(toLong, l -> l); assertEquals(MapperType.LONG_TO_LONG, toLongMapper.mapperType()); }