X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fnotify%2FListNotificationFilter.java;h=76bfbff7766be421bd803c2bdf83bca05a239184;hb=7d89048a7d5e9890d130f37994e8b4a410e692f0;hp=50a10879e5affa4ca4e2755c06d77c0185b4fd5a;hpb=179e7da4d8d8a474d0b622d60b5f5d32d6ab4052;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilter.java b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilter.java index 50a1087..76bfbff 100644 --- a/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilter.java +++ b/src/main/java/net/pterodactylus/sone/notify/ListNotificationFilter.java @@ -1,5 +1,5 @@ /* - * Sone - ListNotificationFilter.java - Copyright © 2010–2019 David Roden + * Sone - ListNotificationFilter.java - Copyright © 2010–2020 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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> filterPostNotification(@Nonnull ListNotification postNotification, @Nullable Sone currentSone) { - List newPosts = from(postNotification.getElements()).filter(postVisibilityFilter.isVisible(currentSone)).toList(); + List 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> filterNewReplyNotification(ListNotification newReplyNotification, @Nonnull Sone currentSone) { - List newReplies = from(newReplyNotification.getElements()).filter(replyVisibilityFilter.isVisible(currentSone)).toList(); + List newReplies = newReplyNotification.getElements().stream().filter(replyVisibilityFilter.isVisible(currentSone)).collect(toList()); if (newReplies.isEmpty()) { return Optional.absent(); }