### Question:
MemoryTimelineStore extends AbstractService implements TimelineStore { @Override public TimelineEntities getEntities(String entityType, Long limit, Long windowStart, Long windowEnd, String fromId, Long fromTs, NameValuePair primaryFilter, Collection<NameValuePair> secondaryFilters, EnumSet<Field> fields) { if (limit == null) { limit = DEFAULT_LIMIT; } if (windowStart == null) { windowStart = Long.MIN_VALUE; } if (windowEnd == null) { windowEnd = Long.MAX_VALUE; } if (fields == null) { fields = EnumSet.allOf(Field.class); } Iterator<TimelineEntity> entityIterator = null; if (fromId != null) { TimelineEntity firstEntity = entities.get(new EntityIdentifier(fromId, entityType)); if (firstEntity == null) { return new TimelineEntities(); } else { entityIterator = new TreeSet<TimelineEntity>(entities.values()) .tailSet(firstEntity, true).iterator(); } } if (entityIterator == null) { entityIterator = new PriorityQueue<TimelineEntity>(entities.values()) .iterator(); } List<TimelineEntity> entitiesSelected = new ArrayList<TimelineEntity>(); while (entityIterator.hasNext()) { TimelineEntity entity = entityIterator.next(); if (entitiesSelected.size() >= limit) { break; } if (!entity.getEntityType().equals(entityType)) { continue; } if (entity.getStartTime() <= windowStart) { continue; } if (entity.getStartTime() > windowEnd) { continue; } if (fromTs != null && entityInsertTimes.get(new EntityIdentifier( entity.getEntityId(), entity.getEntityType())) > fromTs) { continue; } if (primaryFilter != null && !matchPrimaryFilter(entity.getPrimaryFilters(), primaryFilter)) { continue; } if (secondaryFilters != null) { boolean flag = true; for (NameValuePair secondaryFilter : secondaryFilters) { if (secondaryFilter != null && !matchPrimaryFilter( entity.getPrimaryFilters(), secondaryFilter) && !matchFilter(entity.getOtherInfo(), secondaryFilter)) { flag = false; break; } } if (!flag) { continue; } } entitiesSelected.add(entity); } List<TimelineEntity> entitiesToReturn = new ArrayList<TimelineEntity>(); for (TimelineEntity entitySelected : entitiesSelected) { entitiesToReturn.add(maskFields(entitySelected, fields)); } Collections.sort(entitiesToReturn); TimelineEntities entitiesWrapper = new TimelineEntities(); entitiesWrapper.setEntities(entitiesToReturn); return entitiesWrapper; } MemoryTimelineStore(); @Override TimelineEntities getEntities(String entityType, Long limit,
      Long windowStart, Long windowEnd, String fromId, Long fromTs,
      NameValuePair primaryFilter, Collection<NameValuePair> secondaryFilters,
      EnumSet<Field> fields); @Override TimelineEntity getEntity(String entityId, String entityType,
      EnumSet<Field> fieldsToRetrieve); @Override TimelineEvents getEntityTimelines(String entityType,
      SortedSet<String> entityIds, Long limit, Long windowStart,
      Long windowEnd,
      Set<String> eventTypes); @Override TimelinePutResponse put(TimelineEntities data);  }### Answer:
@Test public void testGetEntities() throws IOException { super.testGetEntities(); }