@Contract(value = "null -> null", pure = true)
  public static @Nullable PsiPrimaryPattern getTypedPattern(@Nullable PsiCaseLabelElement element) {
    if (element instanceof PsiDeconstructionPattern) {
      return ((PsiDeconstructionPattern)element);
    }
    else if (element instanceof PsiTypeTestPattern) {
      return ((PsiTypeTestPattern)element);
    }
    else {
      return null;
    }
  }
@Contract(value = "null -> null", pure = true)
  public static @Nullable PsiPrimaryPattern getTypedPattern(@Nullable PsiCaseLabelElement element)