WeatherWebApi { public List<WeatherInfo> pastWeather(double lat, double log, LocalDate from, LocalDate to) { String path = HOST + String.format(PATH_PAST_WEATHER, lat, log, from, to, WEATHER_KEY); List<WeatherInfo> infos = new ArrayList<>(); try( InputStream in = new URL(path).openStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(in))) { String line; while (reader.readLine().startsWith("#")) { } reader.readLine(); while ((line = reader.readLine()) != null) { infos.add(WeatherInfo.valueOf(line)); reader.readLine(); } } catch (IOException e) { throw new RuntimeException(e); } return infos; }  List<WeatherInfo> pastWeather(double lat, double log, LocalDate from, LocalDate to); List<LocationInfo> search(String query);  }
@Test void pastWeather() { }
@Test public void testPastWeather() { WeatherWebApi api = new WeatherWebApi(); List<WeatherInfo> jan = api.pastWeather(37.017, -7.933, LocalDate.of(2020, 1, 1), LocalDate.of(2020, 1, 30)); jan.forEach(System.out::println); }