private static BigDecimal getCurrencyRateForCurrencyCode(String currency) { System.out.println("getting rate for the currency: " + currency); //just a test, in real situation, we might be getting the currency rate // for the provided currency from a cache return new BigDecimal(Math.round(Math.random() * 100)); } }