code: @Nullable
    private XParagraphCursor getParagraphCursor(XComponentContext xContext) {
      try {
        XTextCursor xCursor = getCursor(xContext);
        if (xCursor == null) {
          return null;
        }
        return UnoRuntime.queryInterface(XParagraphCursor.class, xCursor);
      } catch (Throwable t) {
        MessageHandler.printException(t);     // all Exceptions thrown by UnoRuntime.queryInterface are caught
        return null;           // Return null as method failed
      }
  }
docs: Returns ParagraphCursor from TextCursor
  Returns null if it fails