return entities.keySet();
}
Set<HasUuid> toReturn = FlatPackCollections.setForIteration();
for (HasUuid entity : entities.keySet()) {
if (entity instanceof HasTimestamps) {
HasTimestamps ts = (HasTimestamps) entity;
DateTime lastModified = ts.getUpdatedAt() == null ? ts.getCreatedAt() : ts.getUpdatedAt();
if (lastModifiedTime.isBefore(lastModified)) {
toReturn.add(entity);
}
} else {
toReturn.add(entity);