### Question:
DatePicker extends AbstractElement { public void setDate(Calendar to) { navigateMonth(calendar, to); clickDay(to.get(Calendar.DATE)); Calendar cal = calendar; cal.set(Calendar.YEAR, to.get(Calendar.YEAR)); cal.set(Calendar.MONTH, to.get(Calendar.MONTH)); cal.set(Calendar.DATE, to.get(Calendar.DATE)); } DatePicker(String datePickerLocator);  DatePicker(String datePickerLocator, String controlName);  DatePicker(ParentTraits parent, String datePickerLocator);  DatePicker(String datePickerLocator, String controlName, ParentTraits parent);  DatePicker(String datePickerLocator, String prevMonthLocator, String nextMonthLocator, String dateTextLocator); void clickNextMonth(); void clickPrevMonth(); void clickDay(int dayOfMonth); String getDateText(); void setDate(Calendar to); void setDate(String date); void setDate(int year, int month, int day); String getDate(); String getMonth(); String getYear(); String getDayOfMonth(); void datePickerInit(String prevMonthLocator, String nextMonthLocator, String dateTextLocator); void reset();  }### Answer:
@Test(groups = { "browser-tests", "ie-broken-test" }) @WebTest public void testSetDate() throws ParseException { Grid.open(TestServerUtils.getDatePickerURL()); Grid.driver().findElement(By.id(DATE_LOC)).click(); DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy"); Date date = formatter.parse("01/30/2014"); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); datePicker.setDate(calendar); Assert.assertEquals(datePicker.getDayOfMonth(), String.valueOf(calendar.get(Calendar.DAY_OF_MONTH))); Assert.assertEquals(datePicker.getMonth(), String.valueOf(calendar.get(Calendar.MONTH))); Assert.assertEquals(datePicker.getYear(), String.valueOf(calendar.get(Calendar.YEAR))); }