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;
@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();
}
*/
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();
}