ProvinceModel implements PickerItem { public void addCity(CityModel city) { if (null == city) return; if (null == mCityList) mCityList = new ArrayList<CityModel>(); mCityList.add(city); }  void addCity(CityModel city); CityModel getCity(int position); ArrayList<CityModel> getCityList(); int getCityCount(); List<String> getCityIdList(); List<String> getCityNameList(); @Override String getText(); String toString(); public String id; public String name; }
@Test public void testAddCity() { assertEquals(0, model.getCityCount()); model.addCity(null); assertEquals(0, model.getCityCount()); model.addCity(new CityModel()); assertEquals(1, model.getCityCount()); for (CityModel city : cities) { model.addCity(city); } assertEquals(CITIES_NUM + 1, model.getCityCount()); }