🎨 Use Kotlin arrow type instead of Predicate
[Sone.git] / src / main / java / net / pterodactylus / sone / web / WebInterface.java
index 40e5708..4650625 100644 (file)
@@ -17,8 +17,8 @@
 
 package net.pterodactylus.sone.web;
 
-import static com.google.common.collect.FluentIterable.from;
 import static java.util.logging.Logger.getLogger;
+import static java.util.stream.Collectors.toSet;
 
 import java.util.Collection;
 import java.util.Set;
@@ -264,7 +264,7 @@ public class WebInterface implements SessionProvider {
                                .addAll(newPostNotification.getElements())
                                .addAll(localPostNotification.getElements())
                                .build();
-               return from(allNewPosts).filter(postVisibilityFilter.isVisible(currentSone)).toSet();
+               return allNewPosts.stream().filter(p -> postVisibilityFilter.isPostVisible(currentSone, p)).collect(toSet());
        }
 
        @Nonnull
@@ -273,7 +273,7 @@ public class WebInterface implements SessionProvider {
                                .addAll(newReplyNotification.getElements())
                                .addAll(localReplyNotification.getElements())
                                .build();
-               return from(allNewReplies).filter(replyVisibilityFilter.isVisible(currentSone)).toSet();
+               return allNewReplies.stream().filter(r -> replyVisibilityFilter.isReplyVisible(currentSone, r)).collect(toSet());
        }
 
        //