AbstractFormItem implements FormItem<T> { @Override public void setName(String name) { this.name = name; appearances.values().forEach(a -> a.setName(name)); } AbstractFormItem(String name, String label, String hint); @Override HTMLElement element(State state); @Override void attach(); @Override void detach(); @Override String getId(State state); @Override void setId(String id); @Override T getValue(); @Override void setValue(T value); @Override void setValue(T value, boolean fireEvent); @Override void clearValue(); @Override void assignDefaultValue(T defaultValue); @Override void mask(); @Override void unmask(); @Override void fireEvent(GwtEvent<?> gwtEvent); @Override HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> valueChangeHandler); @Override String getName(); @Override void setName(String name); @Override void addValidationHandler(FormItemValidation<T> validationHandler); @Override boolean validate(); @Override void clearError(); @Override void showError(String message); @Override boolean isExpressionAllowed(); @Override void setExpressionAllowed(boolean expressionAllowed); @Override boolean isExpressionValue(); @Override String getExpressionValue(); @Override void setExpressionValue(String expressionValue); @Override void addResolveExpressionHandler(ResolveExpressionHandler handler); @Override void registerSuggestHandler(SuggestHandler suggestHandler); void onSuggest(String suggestion); @Override boolean isRestricted(); @Override void setRestricted(boolean restricted); @Override boolean isEnabled(); @Override void setEnabled(boolean enabled); @Override int getTabIndex(); @Override void setTabIndex(int index); @Override void setAccessKey(char accessKey); @Override void setFocus(boolean focus); @Override String getLabel(); @Override void setLabel(String label); @Override boolean isRequired(); @Override void setRequired(boolean required); @Override final boolean isModified(); @Override void setModified(boolean modified); @Override final boolean isUndefined(); @Override void setUndefined(boolean undefined); @Override boolean isDeprecated(); @Override void setDeprecated(Deprecation deprecation);  }
@Test public void setName() { AbstractFormItem<String> formItem = formItem(false); formItem.setName("foo"); verify(readOnlyAppearance).setName("foo"); verify(editingAppearance).setName("foo"); }