### Question:
OpenWeatherMapWeather implements Weather { void parseCurrentWeather(JSONObject json) throws WeatherException { try { checkCode(json); parseCityId(json); parseLocation(json); parseTime(json); WeatherParser parser = new CurrentWeatherParser(json); parser.parseCondition(); } catch (JSONException e) { throw new WeatherException("Failed parsing current weather: " + e.getLocalizedMessage(), e); } this.empty = false; } OpenWeatherMapWeather(Context context);  OpenWeatherMapWeather(Context context, JSONObject jsonObject); @Override Location getLocation(); @Override Date getTime(); @Override Date getQueryTime(); @Override UnitSystem getUnitSystem(); @Override List<WeatherCondition> getConditions(); @Override boolean isEmpty(); int getCityId(); URL getForecastURL();  }### Answer:
@Test public void testParseTooManyRequestCodeForCurrentWeather() throws JSONException, WeatherException { JSONTokener parser = new JSONTokener("{ \"cod\": 429, \"message\": \"too many requests\"}"); try { OpenWeatherMapWeather weather = new OpenWeatherMapWeather(context); weather.parseCurrentWeather((JSONObject) parser.nextValue()); fail(); } catch (TooManyRequestsException e) { assertEquals("too many requests", e.getMessage()); assertEquals("too many requests", e.getLocalizedMessage()); } }