public boolean typesAreEquivalent(@Nullable PsiType type1, @Nullable PsiType type2) {
    if (type1 == null || type2 == null) {
      return type1 == type2;
    }
    final String type1Text = type1.getCanonicalText();
    final String type2Text = type2.getCanonicalText();
    return type1Text.equals(type2Text);
  }
public boolean typesAreEquivalent(@Nullable PsiType type1, @Nullable PsiType type2)