class YahooStockProvider implements LatestRateProvider, HistoricalRateProvider {

	@Override
	public Quote getLatestRate(String symbol) {
		YahooModel result = rt.getForObject(format(url, symbol), YahooModel.class);

		return result
				.getQuoteResponse().getResult().stream().map(yf -> new Quote(yf.getSymbol(),
						BigDecimal.valueOf(yf.getRegularMarketPrice()), toInstant(yf.getRegularMarketTime())))
				.findFirst().orElse(null);
	}

}