MultiplyUtil { public static <T> ToFloat<T> floatMultiplyFloat(ToFloat<T> first, float second) { class FloatMultiplyFloat extends AbstractMultiplyFloat<T, ToFloat<T>> implements ToFloat<T> { private FloatMultiplyFloat(ToFloat<T> first, float second) { super(first, second); } @Override public float applyAsFloat(T object) { return firstInner.applyAsFloat(object) * secondInner; } } return new FloatMultiplyFloat(first, second); } private  MultiplyUtil(); static ToInt<T> byteMultiplyByte(ToByte<T> first, byte second); static ToInt<T> byteMultiplyInt(ToByte<T> first, int second); static ToLong<T> byteMultiplyLong(ToByte<T> first, long second); static ToInt<T> byteMultiplyByte(ToByte<T> first, ToByte<T> second); static ToInt<T> shortMultiplyByte(ToShort<T> first, byte second); static ToInt<T> shortMultiplyInt(ToShort<T> first, int second); static ToLong<T> shortMultiplyLong(ToShort<T> first, long second); static ToInt<T> shortMultiplyShort(ToShort<T> first, ToShort<T> second); static ToInt<T> intMultiplyByte(ToInt<T> first, byte second); static ToInt<T> intMultiplyInt(ToInt<T> first, int second); static ToLong<T> intMultiplyLong(ToInt<T> first, long second); static ToInt<T> intMultiplyByte(ToInt<T> first, ToByte<T> second); static ToInt<T> intMultiplyInt(ToInt<T> first, ToInt<T> second); static ToLong<T> longMultiplyByte(ToLong<T> first, byte second); static ToLong<T> longMultiplyInt(ToLong<T> first, int second); static ToLong<T> longMultiplyLong(ToLong<T> first, long second); static ToLong<T> longMultiplyInt(ToLong<T> first, ToInt<T> second); static ToLong<T> longMultiplyLong(ToLong<T> first, ToLong<T> second); static ToFloat<T> floatMultiplyInt(ToFloat<T> first, int second); static ToDouble<T> floatMultiplyLong(ToFloat<T> first, long second); static ToFloat<T> floatMultiplyFloat(ToFloat<T> first, float second); static ToFloat<T> floatMultiplyInt(ToFloat<T> first, ToInt<T> second); static ToDouble<T> floatMultiplyLong(ToFloat<T> first, ToLong<T> second); static ToFloat<T> floatMultiplyFloat(ToFloat<T> first, ToFloat<T> second); static ToDouble<T> doubleMultiplyInt(ToDouble<T> first, int second); static ToDouble<T> doubleMultiplyLong(ToDouble<T> first, long second); static ToDouble<T> doubleMultiplyDouble(ToDouble<T> first, double second); static ToDouble<T> doubleMultiplyInt(ToDouble<T> first, ToInt<T> second); static ToDouble<T> doubleMultiplyLong(ToDouble<T> first, ToLong<T> second); static ToDouble<T> doubleMultiplyDouble(ToDouble<T> first, ToDouble<T> second);  }
@Test void floatMultiplyFloat() { ToFloat<Float> instance = MultiplyUtil.floatMultiplyFloat(f -> f, f -> f); assertEquals(1, instance.applyAsFloat((float) 1)); instance = MultiplyUtil.floatMultiplyFloat(f -> f, 1); assertEquals(1, instance.applyAsFloat((float) 1)); }