public static void tryInlineResultVariable(@NotNull PsiLocalVariable resultVar, @NotNull PsiReferenceExpression resultUsage)
    throws IncorrectOperationException {
    PsiElement context = PsiUtil.getVariableCodeBlock(resultVar, null);
    if (context == null) return;
    List<PsiReferenceExpression> references = VariableAccessUtils.getVariableReferences(resultVar);
    if (resultVar.getInitializer() == null) {
      PsiAssignmentExpression assignment = null;
      for (PsiReferenceExpression ref : references) {
        if (ref.getParent() instanceof PsiAssignmentExpression && ((PsiAssignmentExpression)ref.getParent()).getLExpression().equals(ref)) {
          if (assignment != null) {
            assignment = null;
            break;
          }
          else {
            assignment = (PsiAssignmentExpression)ref.getParent();
          }
        }
      }

      if (assignment != null) {
        inlineSingleAssignment(resultVar, assignment, resultUsage);
        return;
      }
    }
    tryReplaceWithTarget(resultVar, resultUsage, context, references);
  }
public static void tryInlineResultVariable(@NotNull PsiLocalVariable resultVar, @NotNull PsiReferenceExpression resultUsage)