### Question:
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Consumer<String> createComponentValueSetter(ComponentWrapper componentWrapper) { return caption -> ((Component)componentWrapper.getComponent()).setCaption(caption); } CaptionAspectDefinition(CaptionType captionType, String staticCaption); @Override Aspect<String> createAspect(); @Override Consumer<String> createComponentValueSetter(ComponentWrapper componentWrapper); @Override boolean supports(WrapperType type); static final String NAME; }### Answer:
@Test public void testCreateComponentValueSetter() { CaptionAspectDefinition captionAspectDefinition = new CaptionAspectDefinition(CaptionType.DYNAMIC, "foo"); Component component = new Label(); ComponentWrapper componentWrapper = new LabelComponentWrapper(component); Consumer<String> componentValueSetter = captionAspectDefinition.createComponentValueSetter(componentWrapper); componentValueSetter.accept("bar"); assertThat(component.getCaption(), is("bar")); }