### Question:
OpBehaviorFloatTrunc extends UnaryOpBehavior { @Override public long evaluateUnary(int sizeout, int sizein, long in1) { FloatFormat format = FloatFormatFactory.getFloatFormat(sizein); return format.opTrunc(in1, sizeout); } OpBehaviorFloatTrunc(); @Override long evaluateUnary(int sizeout, int sizein, long in1); @Override BigInteger evaluateUnary(int sizeout, int sizein, BigInteger in1);  }### Answer:
@Test public void testEvaluateBinaryLong() { OpBehaviorFloatTrunc op = new OpBehaviorFloatTrunc(); FloatFormat ff = FloatFormatFactory.getFloatFormat(8); long a = ff.getEncoding(2.5); long result = op.evaluateUnary(8, 8, a); Assert.assertEquals(2, result); a = ff.getEncoding(-2.5); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(-2, result); a = ff.getEncoding(Double.POSITIVE_INFINITY); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(Long.MAX_VALUE, result); a = ff.getEncoding(Double.NEGATIVE_INFINITY); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(Long.MIN_VALUE, result); a = ff.getEncoding(Double.NaN); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(0, result); }
@Test public void testEvaluateBinaryBigInteger() { OpBehaviorFloatTrunc op = new OpBehaviorFloatTrunc(); FloatFormat ff = FloatFormatFactory.getFloatFormat(8); BigInteger a = ff.getEncoding(BigDecimal.valueOf(2.5d)); BigInteger result = op.evaluateUnary(8, 8, a); Assert.assertEquals(BigInteger.valueOf(2), result); a = ff.getEncoding(BigDecimal.valueOf(-2.5d)); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(BigInteger.valueOf(-2), result); a = ff.getEncoding(FloatFormat.BIG_POSITIVE_INFINITY); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(BigInteger.valueOf(Long.MAX_VALUE), result); a = ff.getEncoding(FloatFormat.BIG_NEGATIVE_INFINITY); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(BigInteger.valueOf(Long.MIN_VALUE), result); a = ff.getEncoding(FloatFormat.BIG_NaN); result = op.evaluateUnary(8, 8, a); Assert.assertEquals(BigInteger.ZERO, result); }