}
public static <K> void expectSingleEvent(K key, EventLogListener eventListener, ClientEvent.Type type, Cache cache) {
switch (type) {
case CLIENT_CACHE_ENTRY_CREATED:
ClientCacheEntryCreatedEvent createdEvent = eventListener.pollEvent(type);
assertEquals(key, createdEvent.getKey());
assertEquals(serverDataVersion(cache, key), createdEvent.getVersion());
break;
case CLIENT_CACHE_ENTRY_MODIFIED:
ClientCacheEntryModifiedEvent modifiedEvent = eventListener.pollEvent(type);
assertEquals(key, modifiedEvent.getKey());
assertEquals(serverDataVersion(cache, key), modifiedEvent.getVersion());