@Test
public void testDatePickerValueChangeHandler() {

    final DatePicker datePicker = mock(DatePicker.class);
    final Date datePickerValue = new Date();
    doReturn(datePickerValue).when(datePicker).getValue();
    factory.initDatePickerByRuleAttribute(datePicker, ruleAttribute);
    verify(datePicker).addValueChangeHandler(valueChangeHandlerArgumentCaptor.capture());
    valueChangeHandlerArgumentCaptor.getValue().onValueChange(null);
    // not robust verifications because of Date formatting / parsing is mocked by GwtMockito
    verify(ruleAttribute).setValue(anyString());
}