### Question:
ModelToUiAspectDefinition implements LinkkiAspectDefinition { @Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { Consumer<V> setter = createComponentValueSetter(componentWrapper); Aspect<V> aspect = createAspect(); return () -> { try { setter.accept(propertyDispatcher.pull(aspect)); } catch (RuntimeException e) { handleUiUpdateException(e, propertyDispatcher, aspect); } }; }  @Override Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper); abstract Aspect<V> createAspect(); abstract Consumer<V> createComponentValueSetter(ComponentWrapper componentWrapper);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testCreateUiUpdater() { when(propertyDispatcher.pull(any(Aspect.class))).thenReturn(true); Handler handler = aspectDefinition.createUiUpdater(propertyDispatcher, componentWrapper); assertThat(componentWrapper.getComponent().isEnabled(), is(false)); handler.apply(); verify(propertyDispatcher, times(1)).pull(any(Aspect.class)); assertThat(componentWrapper.getComponent().isEnabled(), is(true)); handler.apply(); verify(propertyDispatcher, times(2)).pull(any(Aspect.class)); }
@Test public void testCreateUiUpdater_WrapsExceptionInPull() { when(propertyDispatcher.pull(any())).thenThrow(RuntimeException.class); Handler handler = aspectDefinition.createUiUpdater(propertyDispatcher, componentWrapper); Assertions.assertThrows(LinkkiBindingException.class, () -> { handler.apply(); }); }