### Question:
ExchangeRateUtil { public JSONObject parseBlockchainInfoResponse(JSONObject response) { JSONObject formattedRates = new JSONObject(); Iterator<String> iter = response.keys(); while (iter.hasNext()) { String fiatCode = iter.next(); try { JSONObject ReceivedCurrency = response.getJSONObject(fiatCode); JSONObject currentCurrency = new JSONObject(); currentCurrency.put(RATE, ReceivedCurrency.getDouble("15m") / 1e8); currentCurrency.put(SYMBOL, ReceivedCurrency.getString("symbol")); currentCurrency.put(TIMESTAMP, System.currentTimeMillis() / 1000); formattedRates.put(fiatCode, currentCurrency); } catch (JSONException e) { ZapLog.e(LOG_TAG, "Unable to read exchange rate from blockchain.info response."); } } try { JSONObject tempCurrency = formattedRates.getJSONObject("USD"); formattedRates.remove("USD"); formattedRates.put("USD", tempCurrency); } catch (JSONException e) { e.printStackTrace(); } return formattedRates; } private  ExchangeRateUtil(); static ExchangeRateUtil getInstance(); void getExchangeRates(); JSONObject parseBlockchainInfoResponse(JSONObject response); JSONObject parseCoinbaseResponse(JSONObject response); void registerExchangeRateListener(ExchangeRateUtil.ExchangeRateListener listener); void unregisterExchangeRateListener(ExchangeRateUtil.ExchangeRateListener listener);  }### Answer:
@Test public void parseBlockchainInfoResponse() throws JSONException { JSONObject in = new JSONObject(readStringFromFile("exchange_rate_blockchain_info_response.json")); JSONObject out = ExchangeRateUtil.getInstance().parseBlockchainInfoResponse(in); assertEquals(2, out.length()); assertEquals(1E-8, out.getJSONObject("USD").getDouble("rate")); }