### Question:
TimePicker { void onDateChanged(final Moment nativeDate) { getInputBind().value = nativeDate.format(TIME_FORMAT); if (!Objects.isNull(onDateChanged)) { onDateChanged.accept(nativeDate); } } @Inject  TimePicker(final View view); void bind(final HTMLInputElement input); void setOnDateChanged(final Consumer<Moment> onDateChanged); String getValue(); void setValue(final String value);  }### Answer:
@Test public void testOnDateChanged() { final Consumer<Moment> consumer = mock(Consumer.class); picker.setOnDateChanged(consumer); final String expected = "14:55:01"; final Moment moment = mock(Moment.class); when(moment.format("HH:mm:ss")).thenReturn(expected); picker.onDateChanged(moment); assertEquals(expected, input.value); verify(consumer).accept(argThat(new ArgumentMatcher<Moment>() { @Override public boolean matches(Object argument) { return Objects.equals(argument, moment); } })); }