- Notification notification = webInterface.getCore().getNotifications().getNotification(notificationId);
- if ((notification != null) && notification.isDismissable()) {
- webInterface.getCore().getNotifications().removeNotification(notification);
+ Optional<Notification> notification = webInterface.getNotification(notificationId);
+ if (notification.isPresent() && notification.get().isDismissable()) {
+ notification.get().dismiss();