MemoryTimelineStore extends AbstractService implements TimelineStore { @Override public TimelineDomains getDomains(String owner) throws IOException { List<TimelineDomain> domains = new ArrayList<TimelineDomain>(); Set<TimelineDomain> domainsOfOneOwner = domainsByOwner.get(owner); if (domainsOfOneOwner == null) { return new TimelineDomains(); } for (TimelineDomain domain : domainsByOwner.get(owner)) { TimelineDomain domainToReturn = createTimelineDomain( domain.getId(), domain.getDescription(), domain.getOwner(), domain.getReaders(), domain.getWriters(), domain.getCreatedTime(), domain.getModifiedTime()); domains.add(domainToReturn); } Collections.sort(domains, new Comparator<TimelineDomain>() { @Override public int compare( TimelineDomain domain1, TimelineDomain domain2) { int result = domain2.getCreatedTime().compareTo( domain1.getCreatedTime()); if (result == 0) { return domain2.getModifiedTime().compareTo( domain1.getModifiedTime()); } else { return result; } } }); TimelineDomains domainsToReturn = new TimelineDomains(); domainsToReturn.addDomains(domains); return domainsToReturn; } MemoryTimelineStore(); @Override synchronized TimelineEntities getEntities(String entityType, Long limit,
      Long windowStart, Long windowEnd, String fromId, Long fromTs,
      NameValuePair primaryFilter, Collection<NameValuePair> secondaryFilters,
      EnumSet<Field> fields, CheckAcl checkAcl); @Override synchronized TimelineEntity getEntity(String entityId, String entityType,
      EnumSet<Field> fieldsToRetrieve); @Override synchronized TimelineEvents getEntityTimelines(String entityType,
      SortedSet<String> entityIds, Long limit, Long windowStart,
      Long windowEnd,
      Set<String> eventTypes); @Override TimelineDomain getDomain(String domainId); @Override TimelineDomains getDomains(String owner); @Override synchronized TimelinePutResponse put(TimelineEntities data); void put(TimelineDomain domain);  }
@Test public void testGetDomains() throws IOException { super.testGetDomains(); }