Created
April 2, 2018 12:25
-
-
Save deque-blog/247be6b47d5ae88ad1d52fbded4482b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Iterable<PostSummary> suggestedPostsFor(ProfileId profileId) { | |
Iterable<ProfileId> friendIds = friendsOf(profileId); | |
Set<Topic> topics = favoriteTopicsOf(profileId); | |
Stream<PostSummary> interestingPosts = stream(friendIds) | |
.flatMap(friendId -> lastPostsOf(friendId)) | |
.filter(post -> post.isAbout(topics)); | |
return mostLiked(3, interestingPosts); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment