### Question:
LabelComponentWrapper extends VaadinComponentWrapper { @Override public void postUpdate() { getLabelComponent().ifPresent(l -> { l.setEnabled(getComponent().isEnabled()); l.setVisible(getComponent().isVisible()); l.setDescription(getComponent().getDescription()); updateRequiredIndicator(l); }); } LabelComponentWrapper(Component component);  LabelComponentWrapper(@CheckForNull Label label, Component component); @Override void postUpdate(); @Override void setLabel(String labelText); Optional<Label> getLabelComponent(); @Override String toString();  }### Answer:
@Test public void testPostUpdate_AddsRequiredIndicatorToLabelIfFieldIsRequired() { LabelComponentWrapper wrapper = new LabelComponentWrapper(label, field); field.setRequiredIndicatorVisible(true); wrapper.postUpdate(); assertThat(label.getStyleName(), containsString(LinkkiTheme.REQUIRED_LABEL_COMPONENT_WRAPPER)); }
@Test public void testPostUpdate_DoesNotAddRequiredIndicatorToLabelIfFieldIsNotRequired() { LabelComponentWrapper wrapper = new LabelComponentWrapper(label, field); field.setRequiredIndicatorVisible(false); wrapper.postUpdate(); assertThat(label.getStyleName(), not(containsString(LinkkiTheme.REQUIRED_LABEL_COMPONENT_WRAPPER))); }
@Test public void testPostUpdate_DoesNotAddRequiredIndicatorToLabelIfFieldIsReadOnly() { LabelComponentWrapper wrapper = new LabelComponentWrapper(label, field); field.setRequiredIndicatorVisible(true); field.setReadOnly(true); wrapper.postUpdate(); assertThat(label.getStyleName(), not(containsString(LinkkiTheme.REQUIRED_LABEL_COMPONENT_WRAPPER))); }