private @Nullable PsiJavaToken findClosingBracket(@NotNull PsiElement child,
                                                      @NotNull IElementType openBracket,
                                                      @NotNull IElementType closeBracket) {
      int depth = 0;
      do {
        PsiJavaToken token = tryCast(child, PsiJavaToken.class);
        if (token != null) {
          IElementType tokenType = token.getTokenType();
          if (tokenType == openBracket) {
            depth++;
          }
          else if (tokenType == closeBracket) {
            depth--;
          }
          if (depth == 0) break;
        }
        child = nextChild();
      }
      while (child != null);

      return tryCast(child, PsiJavaToken.class);
    }
private @Nullable PsiJavaToken findClosingBracket(@NotNull PsiElement child,
                                                      @NotNull IElementType openBracket,
                                                      @NotNull IElementType closeBracket)