### Question:
HamletImpl extends HamletSpec { public static <E extends CoreAttrs> E setSelector(E e, String selector) { String[] res = parseSelector(selector); if (res[S_ID] != null) { e.$id(res[S_ID]); } if (res[S_CLASS] != null) { e.$class(res[S_CLASS]); } return e; } HamletImpl(PrintWriter out, int nestLevel, boolean wasInline); int nestLevel(); boolean wasInline(); void setWasInline(boolean state); PrintWriter getWriter(); Generic<T> root(String name, EnumSet<EOpt> opts); Generic<T> root(String name); static String[] parseSelector(String selector); static E setSelector(E e, String selector); static E setLinkHref(E e, String href); static E setScriptSrc(E e, String src);  }### Answer:
@Test public void testSetSelector() { CoreAttrs e = mock(CoreAttrs.class); HamletImpl.setSelector(e, "#id.class"); verify(e).$id("id"); verify(e).$class("class"); H1 t = mock(H1.class); HamletImpl.setSelector(t, "#id.class")._("heading"); verify(t).$id("id"); verify(t).$class("class"); verify(t)._("heading"); }