@Test
public void populatesUsersToPosts() {

    String id = "someId";
    RawNewsFeed rawFeed = new RawNewsFeed();
    Post post = mock(Post.class);
    when(post.getUserId()).thenReturn(id);
    List<Post> posts = Arrays.asList(post);
    Map<String, User> users = new HashMap<>();
    User user = mock(User.class);
    users.put(id, user);
    rawFeed.posts = posts;
    rawFeed.users = users;
    rawFeed.postMap = new HashMap<>();
    rawFeed.flatten();
    verify(post).setUser(user);
}