OrderValuesHelper { public BigDecimal adjustPrice(BigDecimal price, Order.OrderType orderType) { return adjustPrice( price, orderType == Order.OrderType.ASK || orderType == Order.OrderType.EXIT_ASK ? RoundingMode.CEILING : RoundingMode.FLOOR); } OrderValuesHelper(CurrencyPairMetaData metaData); boolean amountUnderMinimum(BigDecimal amount); BigDecimal adjustAmount(BigDecimal amount); BigDecimal adjustPrice(BigDecimal price, Order.OrderType orderType); BigDecimal adjustPrice(BigDecimal price, RoundingMode roundingMode);  }
@Test public void shouldAdjustPriceToScale() { given(pairMetaData.getPriceScale()).willReturn(2); BigDecimal result = adjuster.adjustPrice(new BigDecimal("36010.123456789"), RoundingMode.FLOOR); assertThat(result).isEqualByComparingTo("36010.12"); }