SignUtil { public static <T> ToByte<T> signByte(ToByte<T> expression) { class ByteSign extends AbstractSign<T, ToByte<T>> { private ByteSign(ToByte<T> tToByte) { super(tToByte); } @Override public byte applyAsByte(T object) { final byte value = inner.applyAsByte(object); if (value < 0) { return NEGATIVE; } else { return value > 0 ? POSITIVE : ZERO; } } } return new ByteSign(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 signByte() { final ToByte<Byte> signByte = SignUtil.signByte(b -> b); assertEquals(-1, signByte.applyAsByte((byte) -1)); assertEquals(0, signByte.applyAsByte((byte) 0)); assertEquals(1, signByte.applyAsByte((byte) 1)); }