SignUtil { public static <T> ToByte<T> signInt(ToInt<T> expression) { class IntSign extends AbstractSign<T, ToInt<T>> { private IntSign(ToInt<T> tToInt) { super(tToInt); } @Override public byte applyAsByte(T object) { final int value = inner.applyAsInt(object); if (value < 0) { return NEGATIVE; } else { return value > 0 ? POSITIVE : ZERO; } } } return new IntSign(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 signInt() { final ToByte<Integer> signInt = SignUtil.signInt(i -> i); assertEquals(-1, signInt.applyAsByte(-1)); assertEquals(0, signInt.applyAsByte(0)); assertEquals(1, signInt.applyAsByte(1)); }