### Question:
CaptionComponentWrapper extends VaadinComponentWrapper { @Override public void setLabel(String labelText) { getComponent().setCaption(StringUtils.isEmpty(labelText) ? null : labelText); } CaptionComponentWrapper(Component component, WrapperType wrapperType);  CaptionComponentWrapper(String id, Component component, WrapperType wrapperType); @Override void setLabel(String labelText); @Override String toString();  }### Answer:
@Test public void testSetLabel() { Component component = mock(Component.class); CaptionComponentWrapper wrapper = new CaptionComponentWrapper("testID", component, WrapperType.FIELD); wrapper.setLabel("testLabel"); verify(component).setCaption("testLabel"); }
@Test public void testSetLabel_EmptyString() { Component component = new TextField(); CaptionComponentWrapper wrapper = new CaptionComponentWrapper("testID", component, WrapperType.FIELD); wrapper.setLabel(""); assertThat(component.getCaption(), is(nullValue())); }