@Contract(value = "null -> null", pure = true)
  public static @Nullable PsiPatternVariable getPatternVariable(@Nullable PsiCaseLabelElement pattern) {
    if (pattern instanceof PsiTypeTestPattern) {
      return ((PsiTypeTestPattern)pattern).getPatternVariable();
    }
    if (pattern instanceof PsiDeconstructionPattern) {
      return ((PsiDeconstructionPattern)pattern).getPatternVariable();
    }
    return null;
  }
@Contract(value = "null -> null", pure = true)
  public static @Nullable PsiPatternVariable getPatternVariable(@Nullable PsiCaseLabelElement pattern)