static int getTypeRank(@Nullable PsiType type) {
    if (type instanceof PsiClassType) {
      return TYPE_TO_RANK.getInt(getQualifiedName(type));
    }
    else if (type instanceof PsiPrimitiveType) {
      return TYPE_TO_RANK.getInt(((PsiPrimitiveType)type).getBoxedTypeName());
    }
    return 0;
  }
static int getTypeRank(@Nullable PsiType type)