### Question:
TimerSettingsFieldEditorPresenter extends FieldEditorPresenter<TimerSettingsValue> { public void onShowTimeDateTimePicker() { view.showTimeDate(false); String value = view.getTimeDate(); try { Date date = view.parseFromISO(value); view.setTimeDateTimePickerValue(date); } catch (IllegalArgumentException e) { view.setTimeDateTimePickerValue(value); } view.showTimeDateTimePicker(true); } @Inject  TimerSettingsFieldEditorPresenter(final View view); @PostConstruct void init(); View getView(); void setValue(TimerSettingsValue value); @Override void setReadOnly(final boolean readOnly); void onShowTimeDateTimePicker(); void onTimeDateTimePickerChange(); void onTimeDateTimePickerHidden();  }### Answer:
@Test public void testOnShowTimeDateTimePickerWithValidDate() { Date date = new Date(); when(view.getTimeDate()).thenReturn(VALUE_1); when(view.parseFromISO(VALUE_1)).thenReturn(date); editor.onShowTimeDateTimePicker(); verify(view, times(1)).setTimeDateTimePickerValue(date); verify(view, times(1)).showTimeDate(false); }
@Test public void testOnShowTimeDateTimePickerWithInValidDate() { when(view.getTimeDate()).thenReturn(VALUE_1); when(view.parseFromISO(VALUE_1)).thenThrow(new IllegalArgumentException("irrelevant")); editor.onShowTimeDateTimePicker(); verify(view, times(1)).setTimeDateTimePickerValue(VALUE_1); verify(view, times(1)).showTimeDate(false); }