private async Task <T> WhenMessagesReceived <T>(string entityPath, Predicate <T> predicate)
     where T : class
 {
     return(await _messengerService.ReceiveMessage(entityPath, predicate, TimeSpan.FromMilliseconds(1)));
 }