components/src/test/java/eu/internetofus/common/components/task_manager/TaskTransactionPredicates.java
/**
   * Return a predicate the check that the transaction contains the specified
   * message.
   *
   * @param checkMessage predicate to satisfy by at least one message.
   *
   * @return the predicate to check exist at least one message that satisfy the
   *         predicate.
   */
Return a predicate the check that the transaction contains the specified
message.

@param checkMessage predicate to satisfy by at least one message.

@return the predicate to check exist at least one message that satisfy the
predicate.
Return a predicate the check that the transaction contains the specified message . @param checkMessage predicate to satisfy by at least one message . @return the predicate to check exist at least one message that satisfy the predicate .
static Predicate<TaskTransaction> containsMessage(final Predicate<Message> checkMessage) {
    return target -> {
      if (target.messages != null && !target.messages.isEmpty()) {
        for (final var msg : target.messages) {
          if (checkMessage.test(msg)) {
            return true;
          }
        }
      }
      return false;
    };
  }
static Predicate < TaskTransaction > containsMessage ( final Predicate < Message > checkMessage ) { return target -> { if ( target . messages != null && ! target . messages . isEmpty ( ) ) { for ( final var msg : target . messages ) { if ( checkMessage . test ( msg ) ) { return true ; } } } return false ; } ; }
Return a predicate the check that the transaction contains the specified
 message.
Return a predicate the check that the transaction contains the specified message .