### Question:
InMemoryLocalStorage implements LocalStorage { @Override public synchronized LinkedHashMap<Long, String> getFirstNEvents(Integer n, String userId) { LinkedHashMap<Long, String> topEvents = new LinkedHashMap<>(); List<SwrveEventItem> events = eventsPerUserId.get(userId); if(events !=null && events.size() > 0) { int countLeft = n; Iterator<SwrveEventItem> iterator = events.iterator(); while (iterator.hasNext() && countLeft > 0) { SwrveEventItem event = iterator.next(); topEvents.put(event.id, event.event); countLeft--; } } return topEvents; }  @Override synchronized long addEvent(String userId, String eventJSON); @Override synchronized void removeEvents(String userId, Collection<Long> ids); @Override synchronized LinkedHashMap<Long, String> getFirstNEvents(Integer n, String userId); @Override synchronized SwrveCacheItem getCacheItem(String userId, String category); @Override synchronized void setCacheEntry(String userId, String category, String rawData); @Override synchronized String getSecureCacheEntryForUser(String userId, String category, String uniqueKey); @Override synchronized void setSecureCacheEntryForUser(String userId, String category, String rawData, String signature); @Override void saveUser(SwrveUser swrveUser); @Override void deleteUser(String swrveUserId); @Override SwrveUser getUserByExternalUserId(String externalUserId); @Override SwrveUser getUserBySwrveUserId(String swrveUserId); @Override void truncateNotificationsAuthenticated(int rows); @Override void saveNotificationAuthenticated(int notificationId, long time); @Override List<Integer> getNotificationsAuthenticated(); @Override void deleteNotificationsAuthenticated(); @Override void saveOfflineCampaign(String userId, String campaignId, String campaignData); @Override String getOfflineCampaign(String userId, String campaignId);  }### Answer:
@Test public void testInitEmpty() { assertEquals(0, localStorage.getFirstNEvents(10, "userId").size()); }