SignUtil { public static <T> ToByte<T> signLong(ToLong<T> expression) { class LongSign extends AbstractSign<T, ToLong<T>> { private LongSign(ToLong<T> tToLong) { super(tToLong); } @Override public byte applyAsByte(T object) { final long value = inner.applyAsLong(object); if (value < 0) { return NEGATIVE; } else { return value > 0 ? POSITIVE : ZERO; } } } return new LongSign(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 signLong() { final ToByte<Long> signLong = SignUtil.signLong(l -> l); assertEquals(-1, signLong.applyAsByte(-1L)); assertEquals(0, signLong.applyAsByte(0L)); assertEquals(1, signLong.applyAsByte(1L)); }