private static boolean hasRParenth(PsiElement psiElement, PsiElement parent) {
    for (PsiElement sibling = parent.getLastChild(); sibling != psiElement; sibling = sibling.getPrevSibling()) {
      if (PsiUtil.isJavaToken(sibling, JavaTokenType.RPARENTH)) {
        return true;
      }
    }
    return false;
  }
private static boolean hasRParenth(PsiElement psiElement, PsiElement parent)