Anchor extends HtmlContainer implements Focusable<Anchor> { public void removeHref() { getElement().removeAttribute("href"); } Anchor();  Anchor(String href, String text);  Anchor(AbstractStreamResource href, String text);  Anchor(String href, Component... components); void setHref(String href); void removeHref(); void setHref(AbstractStreamResource href); String getHref(); void setTarget(String target); Optional<String> getTarget();  }
@Test public void removeHref() { Anchor anchor = new Anchor(); anchor.setHref("foo"); Assert.assertTrue(anchor.getElement().hasAttribute("href")); anchor.removeHref(); Assert.assertFalse(anchor.getElement().hasAttribute("href")); }
@Test public void shouldNotRemoveRouterIgnoreAttributeWhenRemoveHref() { Anchor anchor = new Anchor(); anchor.getElement().setAttribute("router-ignore", true); anchor.removeHref(); Assert.assertEquals("Anchor element should have router-ignore " + "attribute", "", anchor.getElement().getAttribute("router-ignore")); }