+ @SuppressWarnings("checkstyle:IllegalCatch")
+ public static <T> void assertNoneMatching(ActorRef actor, Class<T> clazz, long timeout) {
+ Exception lastEx = null;
+ int count = (int) (timeout / 50);
+ for (int i = 0; i < count; i++) {
+ try {
+ T message = getFirstMatching(actor, clazz);
+ if (message != null) {
+ Assert.fail("Unexpected message received" + message.toString());
+ return;
+ }
+
+ lastEx = null;
+ } catch (Exception e) {
+ lastEx = e;
+ }
+
+ Uninterruptibles.sleepUninterruptibly(50, TimeUnit.MILLISECONDS);
+ }
+
+ if (lastEx != null) {
+ Throwables.propagate(lastEx);
+ }
+
+ return;
+ }
+
+