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