MinusUtil { public static <T> ToInt<T> shortMinusInt(ToShort<T> first, int second) { class ShortMinusInt extends AbstractMinusInt<T, ToShort<T>> implements ToInt<T> { private ShortMinusInt(ToShort<T> first, int second) { super(first, second); } @Override public int applyAsInt(T object) { return firstInner.applyAsShort(object) - secondInner; } } return new ShortMinusInt(first, second); } private  MinusUtil(); static ToShort<T> byteMinusByte(ToByte<T> first, byte second); static ToInt<T> byteMinusInt(ToByte<T> first, int second); static ToLong<T> byteMinusLong(ToByte<T> first, long second); static ToShort<T> byteMinusByte(ToByte<T> first, ToByte<T> second); static ToInt<T> shortMinusByte(ToShort<T> first, byte second); static ToInt<T> shortMinusInt(ToShort<T> first, int second); static ToLong<T> shortMinusLong(ToShort<T> first, long second); static ToShort<T> shortMinusShort(ToShort<T> first, ToShort<T> second); static ToInt<T> intMinusByte(ToInt<T> first, byte second); static ToInt<T> intMinusInt(ToInt<T> first, int second); static ToLong<T> intMinusLong(ToInt<T> first, long second); static ToInt<T> intMinusByte(ToInt<T> first, ToByte<T> second); static ToInt<T> intMinusInt(ToInt<T> first, ToInt<T> second); static ToLong<T> longMinusByte(ToLong<T> first, byte second); static ToLong<T> longMinusInt(ToLong<T> first, int second); static ToLong<T> longMinusLong(ToLong<T> first, long second); static ToLong<T> longMinusInt(ToLong<T> first, ToInt<T> second); static ToLong<T> longMinusLong(ToLong<T> first, ToLong<T> second); static ToFloat<T> floatMinusInt(ToFloat<T> first, int second); static ToDouble<T> floatMinusLong(ToFloat<T> first, long second); static ToFloat<T> floatMinusFloat(ToFloat<T> first, float second); static ToFloat<T> floatMinusInt(ToFloat<T> first, ToInt<T> second); static ToDouble<T> floatMinusLong(ToFloat<T> first, ToLong<T> second); static ToFloat<T> floatMinusFloat(ToFloat<T> first, ToFloat<T> second); static ToDouble<T> doubleMinusInt(ToDouble<T> first, int second); static ToDouble<T> doubleMinusLong(ToDouble<T> first, long second); static ToDouble<T> doubleMinusDouble(ToDouble<T> first, double second); static ToDouble<T> doubleMinusInt(ToDouble<T> first, ToInt<T> second); static ToDouble<T> doubleMinusLong(ToDouble<T> first, ToLong<T> second); static ToDouble<T> doubleMinusDouble(ToDouble<T> first, ToDouble<T> second);  }
@Test void shortMinusInt() { final ToInt<Short> instance = MinusUtil.shortMinusInt(s -> s, 1); assertEquals(0, instance.applyAsInt((short) 1)); }