Element extends Node<Element> { public Registration addDetachListener( ElementDetachListener detachListener) { if (detachListener == null) { throw new IllegalArgumentException( "ElementDetachListener cannot be null"); } return getNode().addDetachListener( new Command() { @Override public void execute() { detachListener .onDetach(new ElementDetachEvent(Element.this)); } }); } protected  Element(StateNode node, ElementStateProvider stateProvider);  Element(String tag); static Element get(StateNode node); static Element get(StateNode node,
            ElementStateProvider stateProvider); @Override int getChildCount(); @Override Element getChild(int index); @Override Stream<Element> getChildren(); static Element createText(String text); String getTag(); Element setAttribute(String attribute, String value); Element setAttribute(String attribute, boolean value); Element setAttribute(String attribute,
            AbstractStreamResource resource); String getAttribute(String attribute); boolean hasAttribute(String attribute); Stream<String> getAttributeNames(); Element removeAttribute(String attribute); DomListenerRegistration addEventListener(String eventType,
            DomEventListener listener); Element removeFromParent(); Element removeFromTree(); Element getParent(); Element setProperty(String name, String value); Element setProperty(String name, boolean value); Element setProperty(String name, double value); Element setPropertyJson(String name, JsonValue value); Element setPropertyBean(String name, Object value); Element setPropertyList(String name, List<T> value); Element setPropertyMap(String name, Map<String, ?> value); Registration addPropertyChangeListener(String name,
            PropertyChangeListener listener); DomListenerRegistration addPropertyChangeListener(
            String propertyName, String domEventName,
            PropertyChangeListener listener); String getProperty(String name, String defaultValue); String getProperty(String name); boolean getProperty(String name, boolean defaultValue); double getProperty(String name, double defaultValue); int getProperty(String name, int defaultValue); Serializable getPropertyRaw(String name); Element removeProperty(String name); boolean hasProperty(String name); Stream<String> getPropertyNames(); boolean isTextNode(); Element setText(String textContent); String getText(); String getTextRecursively(); ClassList getClassList(); ThemeList getThemeList(); Style getStyle(); Optional<Component> getComponent(); Registration addAttachListener(
            ElementAttachListener attachListener); Registration addDetachListener(
            ElementDetachListener detachListener); @Override String toString(); String getOuterHTML(); T as(Class<T> componentType); @Deprecated void callFunction(String functionName, Serializable... arguments); PendingJavaScriptResult callJsFunction(String functionName,
            Serializable... arguments); @Deprecated void executeJavaScript(String expression,
            Serializable... parameters); PendingJavaScriptResult executeJs(String expression,
            Serializable... parameters); ShadowRoot attachShadow(); Optional<ShadowRoot> getShadowRoot(); Element setVisible(boolean visible); boolean isVisible(); Element setEnabled(final boolean enabled); boolean isEnabled();  }
@Test public void insertAtCurrentPositionNoOp() { UI ui = new UI(); Element parent = ui.getElement(); Element child = ElementFactory.createDiv(); parent.appendChild(child); child.addDetachListener( e -> Assert.fail("Child should not be detached")); parent.insertChild(0, child); }