PlusUtil { public static <T> ToInt<T> shortPlusInt(ToShort<T> first, int second) { class ShortPlusInt extends AbstractPlusInt<T, ToShort<T>> implements ToInt<T> { private ShortPlusInt(ToShort<T> first, int second) { super(first, second); } @Override public int applyAsInt(T object) { return firstInner.applyAsShort(object) + secondInner; } } return new ShortPlusInt(first, second); } private  PlusUtil(); static ToShort<T> bytePlusByte(ToByte<T> first, byte second); static ToInt<T> bytePlusInt(ToByte<T> first, int second); static ToLong<T> bytePlusLong(ToByte<T> first, long second); static ToShort<T> bytePlusByte(ToByte<T> first, ToByte<T> second); static ToInt<T> shortPlusByte(ToShort<T> first, byte second); static ToInt<T> shortPlusInt(ToShort<T> first, int second); static ToLong<T> shortPlusLong(ToShort<T> first, long second); static ToShort<T> shortPlusShort(ToShort<T> first, ToShort<T> second); static ToInt<T> intPlusByte(ToInt<T> first, byte second); static ToInt<T> intPlusInt(ToInt<T> first, int second); static ToLong<T> intPlusLong(ToInt<T> first, long second); static ToInt<T> intPlusByte(ToInt<T> first, ToByte<T> second); static ToInt<T> intPlusInt(ToInt<T> first, ToInt<T> second); static ToLong<T> longPlusByte(ToLong<T> first, byte second); static ToLong<T> longPlusInt(ToLong<T> first, int second); static ToLong<T> longPlusLong(ToLong<T> first, long second); static ToLong<T> longPlusInt(ToLong<T> first, ToInt<T> second); static ToLong<T> longPlusLong(ToLong<T> first, ToLong<T> second); static ToFloat<T> floatPlusInt(ToFloat<T> first, int second); static ToDouble<T> floatPlusLong(ToFloat<T> first, long second); static ToFloat<T> floatPlusFloat(ToFloat<T> first, float second); static ToFloat<T> floatPlusInt(ToFloat<T> first, ToInt<T> second); static ToDouble<T> floatPlusLong(ToFloat<T> first, ToLong<T> second); static ToFloat<T> floatPlusFloat(ToFloat<T> first, ToFloat<T> second); static ToDouble<T> doublePlusInt(ToDouble<T> first, int second); static ToDouble<T> doublePlusLong(ToDouble<T> first, long second); static ToDouble<T> doublePlusDouble(ToDouble<T> first, double second); static ToDouble<T> doublePlusInt(ToDouble<T> first, ToInt<T> second); static ToDouble<T> doublePlusLong(ToDouble<T> first, ToLong<T> second); static ToDouble<T> doublePlusDouble(ToDouble<T> first, ToDouble<T> second);  }
@Test void shortPlusInt() { final ToInt<Short> instance = PlusUtil.shortPlusInt(s -> s, 1); assertEquals(1, instance.applyAsInt((short) 0)); }