- ListNotification<Post> filteredNotification = filterNewPostNotification((ListNotification<Post>) notification, currentSone, true);
- if (filteredNotification != null) {
- filteredNotifications.add(filteredNotification);
+ Optional<ListNotification<Post>> filteredNotification = filterNewPostNotification((ListNotification<Post>) notification, currentSone, true);
+ if (filteredNotification.isPresent()) {
+ filteredNotifications.add(filteredNotification.get());