SignUtil { public static <T> ToByte<T> signShort(ToShort<T> expression) { class ShortSign extends AbstractSign<T, ToShort<T>> { private ShortSign(ToShort<T> tToShort) { super(tToShort); } @Override public byte applyAsByte(T object) { final short value = inner.applyAsShort(object); if (value < 0) { return NEGATIVE; } else { return value > 0 ? POSITIVE : ZERO; } } } return new ShortSign(expression); } private  SignUtil(); static ToByte<T> signBigDecimal(ToBigDecimal<T> expression); static ToByte<T> signDouble(ToDouble<T> expression); static ToByte<T> signFloat(ToFloat<T> expression); static ToByte<T> signLong(ToLong<T> expression); static ToByte<T> signInt(ToInt<T> expression); static ToByte<T> signShort(ToShort<T> expression); static ToByte<T> signByte(ToByte<T> expression);  }
@Test void signShort() { final ToByte<Short> signShort = SignUtil.signShort(s -> s); assertEquals(-1, signShort.applyAsByte((short) -1)); assertEquals(0, signShort.applyAsByte((short) 0)); assertEquals(1, signShort.applyAsByte((short) 1)); }