Notifications dissapearing too soon

Do you know how to let the notifications stay for whole duration when switching pages ? I would like to notify user with notification and let that notification persist on switching page by server.

Example:

if (validateInput(oldPassword, newPassword1, newPassword2)) {
      Notifications.showSuccessNotification("Heslo uspešne zmenené");
      String email = SecurityUtils.getLoggedInUser();
      User user = userService.getUserByEmail(email);
      user.setPassword(newPassword1);
      userService.changePassword(user);
      UI.getCurrent().getPage().setLocation(MainGuestView.URL);
    }

You can try something like, the 5000 is in millis, i.e. 5 seconds.

Notification.show("Heslo uspešne zmenené", 5000, Position.MIDDLE)
                            .addThemeVariants(NotificationVariant.LUMO_SUCCESS);

Excuse me for my incomplete question.

Internal implementation of Notification in my project looks like this and nevertheless it still disappears sooner than 3000ms.

public static void showSuccessNotification(String text) {
    showNotification(text, NotificationVariant.LUMO_SUCCESS);
  }

  /**
   * Method displays a notification inside user's browser window
   *
   * @param text The text of the notification
   * @param variant The variant of the notification
   */
  private static void showNotification(String text, NotificationVariant variant) {
    Notification notification = new Notification(text, 3000);
    notification.addThemeVariants(variant);
    notification.setPosition(Notification.Position.TOP_CENTER);
    notification.open();
  }