### Question:
Sequences { public static Iterable<BigDecimal> halvingDecimal( BigDecimal max, BigDecimal start) { return () -> new BigDecimalHalvingIterator(start, max); } private  Sequences(); static Iterable<BigInteger> halvingIntegral(
        BigInteger max,
        BigInteger start); static Iterable<BigDecimal> halvingDecimal(
        BigDecimal max,
        BigDecimal start); static Iterable<Integer> halving(int start);  }### Answer:
@Test public void halvingBigDecimals() { assertEquals( newArrayList( BigDecimal.valueOf(5), BigDecimal.valueOf(8), BigDecimal.valueOf(9), BigDecimal.TEN), newArrayList(Sequences.halvingDecimal(BigDecimal.TEN, BigDecimal.ZERO))); }
@Test public void halvingNegativeBigDecimals() { assertEquals( newArrayList( BigDecimal.valueOf(-5), BigDecimal.valueOf(-8), BigDecimal.valueOf(-9), BigDecimal.TEN.negate()), newArrayList(Sequences.halvingDecimal(BigDecimal.TEN.negate(), BigDecimal.ZERO))); }
@Test public void callingNextOutOfSequenceOnHalvingBigDecimals() { Iterator<BigDecimal> i = Sequences.halvingDecimal(BigDecimal.ZERO, BigDecimal.ZERO).iterator(); i.next(); thrown.expect(NoSuchElementException.class); i.next(); }