MultiplyUtil { public static <T> ToInt<T> shortMultiplyShort(ToShort<T> first, ToShort<T> second) { class ShortMultiplyShort extends AbstractMultiply<T, ToShort<T>, ToShort<T>> implements ToInt<T> { private ShortMultiplyShort(ToShort<T> first, ToShort<T> second) { super(first, second); } @Override public int applyAsInt(T object) { return firstInner.applyAsShort(object) * secondInner.applyAsShort(object); } } return new ShortMultiplyShort(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 shortMultiplyShort() { final ToInt<Short> instance = MultiplyUtil.shortMultiplyShort(s -> s, s -> s); assertEquals(1, instance.applyAsInt((short) 1)); }