🎨 Use Kotlin arrow type instead of Predicate
[Sone.git] / src / main / java / net / pterodactylus / sone / notify / ListNotificationFilter.java
index 739907c..76bfbff 100644 (file)
@@ -17,7 +17,7 @@
 
 package net.pterodactylus.sone.notify;
 
-import static com.google.common.collect.FluentIterable.from;
+import static java.util.stream.Collectors.toList;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -119,7 +119,7 @@ public class ListNotificationFilter {
        @Nonnull
        private Optional<ListNotification<Post>> filterPostNotification(@Nonnull ListNotification<Post> postNotification,
                        @Nullable Sone currentSone) {
-               List<Post> newPosts = from(postNotification.getElements()).filter(postVisibilityFilter.isVisible(currentSone)).toList();
+               List<Post> newPosts = postNotification.getElements().stream().filter(postVisibilityFilter.isVisible(currentSone)).collect(toList());
                if (newPosts.isEmpty()) {
                        return Optional.absent();
                }
@@ -148,7 +148,7 @@ public class ListNotificationFilter {
         */
        private Optional<ListNotification<PostReply>> filterNewReplyNotification(ListNotification<PostReply> newReplyNotification,
                        @Nonnull Sone currentSone) {
-               List<PostReply> newReplies = from(newReplyNotification.getElements()).filter(replyVisibilityFilter.isVisible(currentSone)).toList();
+               List<PostReply> newReplies = newReplyNotification.getElements().stream().filter(replyVisibilityFilter.isVisible(currentSone)).collect(toList());
                if (newReplies.isEmpty()) {
                        return Optional.absent();
                }