class PostFeedToList implements Func1<PostListFeed, List<Post>> {

    @Override
    public List<Post> call(PostListFeed feed) {
        if(feed == null || feed.posts == null) {
            return new ArrayList<>();
        }
        List<Post> posts = feed.posts;
        Map<String, User> users = feed.users;
        for(Post post: posts) {
            post.setUser(users.get(post.getUserId()));
        }
        return posts;
    }

}