### Question:
FxRateImpl implements FxRate { @Override public BigDecimal getMid() { BigDecimal mid; if (isNullOrZero(ask)) { mid = bid; } else if (isNullOrZero(bid)) { mid = ask; } else { mid = divide(PRECISION_FOR_INVERSE, bid.add(ask), TWO, BigDecimal.ROUND_HALF_UP); } return mid; } FxRateImpl(final CurrencyPair currencyPair, final String crossCcy, final boolean marketConvention, final BigDecimal bid,
            final BigDecimal ask, CurrencyProvider currencyProvider); @Override String getDescription(); @Override FxRate createInverse(); @Override FxRate createInverse(final int precision); @Override BigDecimal getBid(); @Override BigDecimal getAsk(); @Override CurrencyPair getCurrencyPair(); @Override Optional<String> getCrossCcy(); @Override boolean isMarketConvention(); @Override BigDecimal getMid(); @Override BigDecimal getBidInMarketConvention(); @Override BigDecimal getMidInMarketConvention(); @Override BigDecimal getAskInMarketConvention(); @Override String toString(); @Override CurrencyAmount convertAmountUsingMid(final CurrencyAmount originalAmount); @Override CurrencyAmount convertAmountUsingBidOrAsk(final CurrencyAmount originalAmount); @Override CurrencyAmount getPaymentAmountForBuying(final CurrencyAmount amountToBuy); @Override CurrencyAmount getReceiptAmountForSelling(final CurrencyAmount amountToSell);  }### Answer:
@Test public void testMid() { FxRateImpl fx = new FxRateImpl(new CurrencyPair("EUR", "USD"), null, true, bd("1.6"), bd("1.61"), new JdkCurrencyProvider()); assertThat(fx.getMid()).isEqualByComparingTo("1.605"); }