public void TestListenerWithNonSmartRouting() { var map = _client.GetMap <string, string>(TestSupport.RandomString()); var keys = TestSupport.RandomArray(TestSupport.RandomString, 10); var registrations = new List <string>(); var tasks = new List <Task>(); foreach (var key in keys) { var tcs = new TaskCompletionSource <bool>(); var id = map.AddEntryListener(new EntryAdapter <string, string> { Added = e => tcs.SetResult(true) }, key, false); registrations.Add(id); tasks.Add(tcs.Task); } foreach (var key in keys) { map.Put(key, TestSupport.RandomString()); } Assert.IsTrue(Task.WaitAll(tasks.ToArray(), 500), "Did not get all entry added events within 500ms"); foreach (var id in registrations) { Assert.IsTrue(map.RemoveEntryListener(id)); } }