public static boolean canBeDeclaredFinal(@NotNull PsiVariable variable) {
    LOG.assertTrue(variable instanceof PsiLocalVariable || variable instanceof PsiParameter);
    final boolean isReassigned = HighlightControlFlowUtil
      .isReassigned(variable, new HashMap<>());
    return !isReassigned;
  }
public static boolean canBeDeclaredFinal(@NotNull PsiVariable variable)