@Test
public void roundingInAdjustedBill_shouldConsiderRoundingOfPreviousBill() throws Exception {

	CashierOptions cashierOptions = cashOptService.getOptions();
	Assert.assertEquals(5, (int)cashierOptions.getRoundToNearest());
	// Test bill
	Bill bill = new Bill();
	BillLineItem item = new BillLineItem();
	Item lineItemItem = new Item(1);
	item.setItem(lineItemItem);
	item.setLineItemOrder(0);
	item.setPrice(new BigDecimal(8));
	item.setQuantity(1);
	bill.addLineItem(item);
	IItemDataService itemService = Context.getService(IItemDataService.class);
	Item roundingItem = itemService.getByUuid(cashierOptions.getRoundingItemUuid());
	Assert.assertEquals(1, bill.getLineItems().size());
	RoundingUtil.handleRoundingLineItem(bill);
	Assert.assertEquals(2, bill.getLineItems().size());
	item.setLineItemOrder(1);
	bill.addLineItem(item);
	Assert.assertEquals(3, bill.getLineItems().size());
	RoundingUtil.handleRoundingLineItem(bill);
	Assert.assertEquals(3, bill.getLineItems().size());
	BigDecimal roundingValue = new BigDecimal(0);
	BigDecimal itemTotal = new BigDecimal(0);
	int roundingItemCounter = 0;
	for (BillLineItem lineItem : bill.getLineItems()) {
		if (lineItem.getItem() != null && roundingItem.getId().equals(lineItem.getItem().getId())) {
			roundingValue = roundingValue.add(lineItem.getTotal());
			roundingItemCounter++;
		} else {
			itemTotal = itemTotal.add(lineItem.getTotal());
		}
	}
	Assert.assertEquals(16, itemTotal.intValue());
	Assert.assertEquals(-1, roundingValue.intValue());
	Assert.assertEquals(1, roundingItemCounter);
}