@Test
public void roundingInAdjustedBill_shouldUpdateRoundingLineItemIfRoundingDifferenceIsNotZero() throws Exception {

	// 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(7));
	item.setQuantity(1);
	bill.addLineItem(item);
	Assert.assertEquals(1, bill.getLineItems().size());
	RoundingUtil.handleRoundingLineItem(bill);
	Assert.assertEquals(2, bill.getLineItems().size());
	CashierOptions cashierOptions = cashOptService.getOptions();
	IItemDataService itemService = Context.getService(IItemDataService.class);
	Item roundingItem = itemService.getByUuid(cashierOptions.getRoundingItemUuid());
	BillLineItem roundingLineItem = null;
	for (BillLineItem lineItem : bill.getLineItems()) {
		if (roundingItem.equals(lineItem.getItem())) {
			roundingLineItem = lineItem;
		}
	}
	Assert.assertNotNull(roundingLineItem);
	Assert.assertEquals(roundingLineItem.getTotal().intValue(), -2);
	bill.addLineItem(item);
	Assert.assertEquals(3, bill.getLineItems().size());
	RoundingUtil.handleRoundingLineItem(bill);
	Assert.assertEquals(3, bill.getLineItems().size());
	roundingLineItem = null;
	for (BillLineItem lineItem : bill.getLineItems()) {
		if (roundingItem.equals(lineItem.getItem())) {
			roundingLineItem = lineItem;
		}
	}
	Assert.assertNotNull(roundingLineItem);
	Assert.assertEquals(roundingLineItem.getTotal().intValue(), 1);
}