ProvinceModel implements PickerItem { public List<String> getCityIdList() { int count = getCityCount(); List<String> cityIdList = new ArrayList<String>(); for (int i = 0; i < count; i++) { cityIdList.add(mCityList.get(i).id); } return cityIdList; }  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 testGetCityIdList() { assertTrue(model.getCityIdList().isEmpty()); model.addCity(new CityModel()); assertEquals(1, model.getCityIdList().size()); assertNull(model.getCityIdList().get(0)); for (CityModel city : cities) { model.addCity(city); } assertEquals(CITIES_NUM + 1, model.getCityIdList().size()); assertNull(model.getCityIdList().get(0)); for (int i=0; i<cities.length; i++) { assertEquals(cities[i].id, model.getCityIdList().get(i+1)); } }