protected <T extends MaterialAvatar> void checkNameAndHashCode(T avatar) {
   final String NAME = "test1";
   avatar.setName(NAME);
   avatar.initialize();
   final String HASH_CODE = JsAvatar.md5(NAME);
   assertEquals(avatar.getName(), NAME);
   assertTrue(avatar.getElement().hasAttribute("data-jdenticon-hash"));
   assertEquals(avatar.getElement().getAttribute("data-jdenticon-hash"), HASH_CODE);
 }
  protected <T extends MaterialAvatar> void checkSVGWithHeight(T avatar) {
    final String WIDTH = "50";
    final String HEIGHT = "50";
    avatar.setWidth(WIDTH);
    avatar.setHeight(HEIGHT);

    assertTrue(avatar.getElement().hasAttribute("width"));
    assertEquals(avatar.getElement().getAttribute("width"), WIDTH);

    assertTrue(avatar.getElement().hasAttribute("height"));
    assertEquals(avatar.getElement().getAttribute("height"), HEIGHT);
  }
 protected void appendText(T wrapped, String data) {
   if (HasText.class.isInstance(wrapped)) {
     ((HasText) wrapped).setText(data);
   } else {
     Text text = JavaScriptObjects.newText(data);
     wrapped.getElement().appendChild(text);
   }
 }
 @NotNull
 public <T extends PsiPolyVariantReference> ResolveResult[] resolveWithCaching(
     @NotNull T ref,
     @NotNull PolyVariantResolver<T> resolver,
     boolean needToPreventRecursion,
     boolean incompleteCode) {
   return resolveWithCaching(
       ref,
       resolver,
       needToPreventRecursion,
       incompleteCode,
       ref.getElement().getContainingFile());
 }
 protected void appendElement(T wrapped, Element child) {
   wrapped.getElement().appendChild(child);
 }