private static boolean isLastParameter(@NotNull PsiElement context) {
    if (context instanceof PsiParameter) {
      final PsiElement scope = ((PsiParameter)context).getDeclarationScope();
      if (scope instanceof PsiMethod) {
        final PsiParameter[] parameters = ((PsiMethod)scope).getParameterList().getParameters();
        return parameters.length > 0 && parameters[parameters.length - 1] == context;
      }
    }
    return false;
  }
private static boolean isLastParameter(@NotNull PsiElement context)