A small service builds a basket total string and a separate list of line items. Right now, in one of the calculation paths, the total and the lines can differ for values where the rounding method matters.
PricingReport.build must accept a list of LineItem and return a Report.Report.total and the string values in Report.lines must use the same rounding arithmetic.BigDecimal and RoundingMode.HALF_UP.List(
LineItem("tea", 1, 1.255),
LineItem("cake", 2, 0.335)
)
report.total and the sum over report.lines.Double.scala-cli test . or equivalent compilation/checking for a single fileUse line comments to explain the problem, its impact, the fix and how to test it.