SignUtil { public static <T> ToByte<T> signFloat(ToFloat<T> expression) { class FloatSign extends AbstractSign<T, ToFloat<T>> { private FloatSign(ToFloat<T> tToFloat) { super(tToFloat); } @Override public byte applyAsByte(T object) { final float value = inner.applyAsFloat(object); if (value < 0) { return NEGATIVE; } else { return value > 0 ? POSITIVE : ZERO; } } } return new FloatSign(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 signFloat() { final ToByte<Float> signFloat = SignUtil.signFloat(f -> f); assertEquals(-1, signFloat.applyAsByte(-1f)); assertEquals(0, signFloat.applyAsByte(0f)); assertEquals(1, signFloat.applyAsByte(1f)); }