public Optional<BigDecimal> convertToUsd(final BigDecimal amount, final String currency) {
    if ("USD".equalsIgnoreCase(currency)) {
      return Optional.of(amount);
    }

    return Optional.ofNullable(cachedFixerValues.get(currency.toUpperCase(Locale.ROOT)))
        .map(conversionRate -> amount.divide(conversionRate, 2, RoundingMode.HALF_EVEN));
  }
@Test
  void convertToUsd() {
    final CurrencyConversionManager currencyConversionManager = new CurrencyConversionManager(mock(FixerClient.class),
        mock(CoinMarketCapClient.class),
        mock(FaultTolerantRedisCluster.class),
        Collections.emptyList(),
        EXECUTOR,
        Clock.systemUTC());

    currencyConversionManager.setCachedFixerValues(Map.of("JPY", BigDecimal.valueOf(154.757008), "GBP", BigDecimal.valueOf(0.81196)));

    assertEquals(Optional.of(new BigDecimal("17.50")),
        currencyConversionManager.convertToUsd(new BigDecimal("17.50"), "USD"));

    assertEquals(Optional.of(new BigDecimal("17.50")),
        currencyConversionManager.convertToUsd(new BigDecimal("17.50"), "usd"));

    assertEquals(Optional.empty(),
        currencyConversionManager.convertToUsd(new BigDecimal("10.00"), "XYZ"));

    assertEquals(Optional.of(new BigDecimal("12.92")),
        currencyConversionManager.convertToUsd(new BigDecimal("2000"), "JPY"));

    assertEquals(Optional.of(new BigDecimal("12.32")),
        currencyConversionManager.convertToUsd(new BigDecimal("10"), "GBP"));
  }