+ final Boolean notificationEnabled = new ExpectMsg<Boolean>("enable notification") {
+ // do not put code outside this method, will run afterwards
+ protected Boolean match(Object in) {
+ if(in instanceof EnableNotification){
+ return ((EnableNotification) in).isEnabled();
+ } else {
+ throw noMatch();
+ }
+ }
+ }.get(); // this extracts the received message
+
+ assertFalse(notificationEnabled);
+
+ final String out = new ExpectMsg<String>(duration("1 seconds"), "match hint") {