@Test
 public void testIssue321() throws Exception {
   HazelcastClient hClient = getHazelcastClient();
   final IMap<Integer, Integer> imap = hClient.getMap("testIssue321_1");
   final BlockingQueue<EntryEvent<Integer, Integer>> events1 =
       new LinkedBlockingQueue<EntryEvent<Integer, Integer>>();
   final BlockingQueue<EntryEvent<Integer, Integer>> events2 =
       new LinkedBlockingQueue<EntryEvent<Integer, Integer>>();
   imap.addEntryListener(
       new EntryAdapter<Integer, Integer>() {
         @Override
         public void entryAdded(EntryEvent event) {
           events2.add(event);
         }
       },
       false);
   imap.addEntryListener(
       new EntryAdapter<Integer, Integer>() {
         @Override
         public void entryAdded(EntryEvent event) {
           events1.add(event);
         }
       },
       true);
   imap.put(1, 1);
   final EntryEvent<Integer, Integer> event1 = events1.poll(10, TimeUnit.MILLISECONDS);
   final EntryEvent<Integer, Integer> event2 = events2.poll(10, TimeUnit.MILLISECONDS);
   assertNotNull(event1);
   assertNotNull(event2);
   assertNotNull(event1.getValue());
   assertNull(event2.getValue());
 }
 @Override
 public void entryAdded(EntryEvent<String, BpmEvent> event) {
   BpmEvent bpmEvent = event.getValue();
   logger.log(
       Level.INFO,
       "BpmEventListener.entryAdded executor {0}",
       new Object[] {bpmEvent.getExecutor()});
   try {
     BpmEvent.EXECUTOR executor = bpmEvent.getExecutor();
     switch (executor) {
       case ACTOR_RESOLVER:
         InternalAPI.get().executeActorResolver(bpmEvent.getCaseId(), bpmEvent.getTaskId());
         break;
       case CONNECTOR:
         InternalAPI.get().executeConnectorOut(bpmEvent.getCaseId(), bpmEvent.getTaskId());
         break;
       case JOIN:
         InternalAPI.get()
             .executeJoin(bpmEvent.getCaseId(), bpmEvent.getTaskId(), bpmEvent.getJoinId());
         break;
       case TRANSITION:
         InternalAPI.get().executeTransition(bpmEvent.getCaseId(), bpmEvent.getTaskId());
         break;
     }
     HazelcastServer.removeBpmEvent(bpmEvent);
   } catch (Exception ex) {
     logger.log(Level.SEVERE, ex.getMessage(), ex);
   }
 }
 @Override
 public void entryUpdated(EntryEvent<K, V> entry) {
   K k = entry.getKey();
   ChoosableSet<V> entries = cache.get(k);
   if (entries != null) {
     entries.add(entry.getValue());
   }
 }
 public void entryAdded(EntryEvent<String, ExpiringSession> event) {
   if (logger.isDebugEnabled()) {
     logger.debug("Session created with id: " + event.getValue().getId());
   }
   this.eventPublisher.publishEvent(new SessionCreatedEvent(this, event.getValue()));
 }
 @Override
 public void entryRemoved(EntryEvent<K, V> entry) {
   removeEntry(entry.getKey(), entry.getValue());
 }
 @Override
 public void entryAdded(EntryEvent<K, V> entry) {
   addEntry(entry.getKey(), entry.getValue());
 }