public static boolean isLeafElementOfType(@Nullable PsiElement element, @NotNull IElementType type) {
    return element instanceof LeafElement && ((LeafElement)element).getElementType() == type;
  }
public static boolean isLeafElementOfType(@Nullable PsiElement element, @NotNull IElementType type)