@Contract("null -> null")
  @Nullable
  private static GrVariable getVariable(@Nullable PsiElement instructionElement) {
    final GrVariable variable;
    if (instructionElement instanceof GrReferenceExpression) {
      final PsiElement resolved = ((GrReferenceExpression)instructionElement).resolve();
      variable = resolved instanceof GrVariable ? (GrVariable)resolved : null;
    }
    else if (instructionElement instanceof GrVariable) {
      variable = (GrVariable)instructionElement;
    }
    else {
      variable = null;
    }
    return variable != null && PsiUtil.isLocalOrParameter(variable) ? variable : null;
  }
@Contract("null -> null")
  @Nullable
  private static GrVariable getVariable(@Nullable PsiElement instructionElement)