public Set<EntityKey> getEntityKeys() {
   Set<EntityKey> entityKeys = Sets.newHashSet();
   for (SessionStatistics s : sessionStatistics) {
     @SuppressWarnings("unchecked")
     Set<EntityKey> shardEntityKeys = (Set<EntityKey>) s.getEntityKeys();
     entityKeys.addAll(shardEntityKeys);
   }
   return entityKeys;
 }
 public Set<CollectionKey> getCollectionKeys() {
   Set<CollectionKey> collectionKeys = Sets.newHashSet();
   for (SessionStatistics s : sessionStatistics) {
     @SuppressWarnings("unchecked")
     Set<CollectionKey> shardCollectionKeys = (Set<CollectionKey>) s.getCollectionKeys();
     collectionKeys.addAll(shardCollectionKeys);
   }
   return collectionKeys;
 }
 public ShardedSessionStatistics(ShardedSessionImplementor session) {
   sessionStatistics = Sets.newHashSet();
   for (Shard s : session.getShards()) {
     if (s.getSession() != null) {
       sessionStatistics.add(s.getSession().getStatistics());
     } else {
       OpenSessionEvent ose =
           new OpenSessionEvent() {
             public void onOpenSession(Session session) {
               sessionStatistics.add(session.getStatistics());
             }
           };
       s.addOpenSessionEvent(ose);
     }
   }
 }