OandaHistoricMarketDataProvider implements HistoricMarketDataProvider<String> { String getFromToUrl(TradeableInstrument<String> instrument, CandleStickGranularity granularity, DateTime from, DateTime to) { return String .format("%s%s?instrument=%s&candleFormat=midpoint&granularity=%s&dailyAlignment=0&alignmentTimezone=%s&start=%d&end=%d", this.url, OandaConstants.CANDLES_RESOURCE, instrument.getInstrument(), granularity.name(), tzGMT, TradingUtils.toUnixTime(from), TradingUtils.toUnixTime(to)); } OandaHistoricMarketDataProvider(String url, String accessToken); @Override List<CandleStick<String>> getCandleSticks(TradeableInstrument<String> instrument,
			CandleStickGranularity granularity, DateTime from, DateTime to); @Override List<CandleStick<String>> getCandleSticks(TradeableInstrument<String> instrument,
			CandleStickGranularity granularity, int count);  }
@Test public void fromToUrlTest() { OandaHistoricMarketDataProvider service = new OandaHistoricMarketDataProvider(OandaTestConstants.url, OandaTestConstants.accessToken); String url = service.getFromToUrl(new TradeableInstrument<String>("CHF_JPY"), CandleStickGranularity.S5, new DateTime(1442950140000L), new DateTime(1442960940000L)); assertEquals( "https: url); }