@Test
public void returnsEvents() {

    String id = "someId";
    RawNewsFeed rawFeed = new RawNewsFeed();
    Event event = mock(Event.class);
    List<Event> events = Arrays.asList(event);
    when(event.getUserId()).thenReturn(id);
    Map<String, User> users = new HashMap<>();
    User user = mock(User.class);
    users.put(id, user);
    rawFeed.events = events;
    rawFeed.users = users;
    rawFeed.postMap = new HashMap<>();
    NewsFeed feed = rawFeed.flatten();
    assertThat(feed.getEvents(), equalTo(events));
}