protected static @Nullable PsiElement findSingleConditionalReturn(@NotNull Project project, @NotNull Document document, int line) {
    if (!DocumentUtil.isValidLine(line, document)) return null;

    class RetFinder implements Processor<PsiElement> {
      // Our ultimate goal is to find the single return statement which is executed conditionally to break on it.
      // However, in most cases it's enough to just check that return is not the first on the line
      // (code like `workHard(); return result();` is quite rare,
      // also note that putting breakpoint on such return would not lead to catastrophic circumstances).
      // We ignore multiple returns because it's not easy to map them in source code to multiple return instructions in bytecode.

      boolean somethingBeforeReturn = false;
      @Nullable PsiElement singleReturn = null;

      @Override
      public boolean process(PsiElement element) {
        if (isReturnKeyword(element)) {
          if (singleReturn != null) {
            singleReturn = null;
            return false;
          }

          if (!somethingBeforeReturn) {
            assert singleReturn == null;
            return false;
          }

          singleReturn = element;
        }

        if (!(element instanceof PsiWhiteSpace || element instanceof PsiComment)) {
          somethingBeforeReturn = true;
        }

        return true;
      }
    }
    RetFinder finder = new RetFinder();
    XDebuggerUtil.getInstance().iterateLine(project, document, line, finder);
    return finder.singleReturn;
  }
protected static @Nullable PsiElement findSingleConditionalReturn(@NotNull Project project, @NotNull Document document, int line)