### Question:
OrderCalc { public long getPriceWithoutVAT(LineItem lineItem) { CalcLineItem calcLineItem = new CalcLineItem(lineItem); return getCalc().getPriceWithoutVat(calcLineItem).getCents(); } OrderCalc(Order order); long getTax(); long getTax(Collection<LineItem> lines); long getTip(); long getTotal(Collection<LineItem> lines); long getTotalBeforeRefunds(final Collection<LineItem> lines); long getDiscountedSubtotal(Collection<LineItem> lines); long getLineSubtotal(Collection<LineItem> lines); long getLineSubtotalBeforeRefunds(final Collection<LineItem> lines); long getLineSubtotalWithoutDiscounts(Collection<LineItem> lines); long getLineExtendedPrice(LineItem line); long getServiceCharge(); long getServiceCharge(Collection<LineItem> lines); long getTotalWithTip(Collection<LineItem> lines); List<Calc.TaxSummary> getTaxSummaries(Collection<LineItem> lines); List<Calc.TaxSummary> getTaxSummariesBeforeRefunds(final Collection<LineItem> lines, final Decimal overrideSplitPercent); Decimal getDiscountMultiplier(); Calc.PaymentDetails getPaymentDetails(long paymentAmount); Calc.PaymentDetails getPaymentDetails(long paymentAmount, Collection<LineItem> lines); long getPriceWithoutVAT(LineItem lineItem); long getPriceWithVAT(LineItem lineItem);  }### Answer:
@Test public void testMultiplePercentRatesAndFlatRatesWithoutVat() { final TaxRate percent10TaxRate = newPercentRate("10_pct", 1000000L); final TaxRate percent20TaxRate = newPercentRate("20_pct", 2000000L); final TaxRate taxRate = newFlatTax(); final LineItem lineItem = new LineItem(); lineItem.setPrice(350L); final List<TaxRate> taxRates = new ArrayList<>(); taxRates.add(percent10TaxRate); taxRates.add(percent20TaxRate); taxRates.add(taxRate); lineItem.setTaxRates(taxRates); assertEquals(254L, orderCalc.getPriceWithoutVAT(lineItem)); }
@Test(expected = IllegalArgumentException.class) public void testPriceWithoutVAT_negativePrice() { final LineItem lineItem = new LineItem(); lineItem.setPrice(-1L); orderCalc.getPriceWithoutVAT(lineItem); }
@Test public void testPriceWithoutVat() { LineItem lineItem = new LineItem(); lineItem.setPrice(350L); assertEquals(350L, orderCalc.getPriceWithoutVAT(lineItem)); }
@Test public void testSinglePercentRateWithoutVat() { final TaxRate percent20TaxRate = newPercentRate("20_pct", 2000000L); final LineItem lineItem = new LineItem(); lineItem.setPrice(350L); List<TaxRate> taxRates = new ArrayList<>(); taxRates.add(percent20TaxRate); lineItem.setTaxRates(taxRates); assertEquals(292L, orderCalc.getPriceWithoutVAT(lineItem)); }
@Test public void testMultiplePercentRatesWithoutVat() { final TaxRate percent10TaxRate = newPercentRate("10_pct", 1000000L); final TaxRate percent20TaxRate = newPercentRate("20_pct", 2000000L); final LineItem lineItem = new LineItem(); lineItem.setPrice(350L); final List<TaxRate> taxRates = new ArrayList<>(); taxRates.add(percent10TaxRate); taxRates.add(percent20TaxRate); lineItem.setTaxRates(taxRates); assertEquals(269L, orderCalc.getPriceWithoutVAT(lineItem)); }