protocols/src/test/java/eu/internetofus/common/protocols/AbstractAsk4HelpV2ProtocolITC.java
/**
   * Create a predicate that check that the specified user receive the question to
   * answer.
   *
   * @param userId identifier of the user to receive the question to answer.
   *
   * @return predicate to check that the user has received the task question.
   */
Create a predicate that check that the specified user receive the question to
answer.

@param userId identifier of the user to receive the question to answer.

@return predicate to check that the user has received the task question.
Create a predicate that check that the specified user receive the question to answer . @param userId identifier of the user to receive the question to answer . @return predicate to check that the user has received the task question .
protected Predicate<Message> createMessagePredicateForQuestionToAnswerMessageBy(final String userId) {
    return this.createMessagePredicate().and(MessagePredicates.labelIs("QuestionToAnswerMessage"))
        .and(MessagePredicates.receiverIs(userId)).and(target -> {
          if (this.task == null) {
            return false;
          }
          final var attributes = new JsonObject().put("question", this.task.goal.name).put("taskId", this.task.id)
              .put("userId", this.task.requesterId).put("sensitive", this.task.attributes.getBoolean("sensitive"))
              .put("anonymous", this.task.attributes.getBoolean("anonymous"))
              .put("positionOfAnswerer", this.task.attributes.getString("positionOfAnswerer"));
          return MessagePredicates.attributesSimilarTo(attributes).test(target);
        });
  }
protected Predicate < Message > createMessagePredicateForQuestionToAnswerMessageBy ( final String userId ) { return this . createMessagePredicate ( ) . and ( MessagePredicates . labelIs ( "QuestionToAnswerMessage" ) ) . and ( MessagePredicates . receiverIs ( userId ) ) . and ( target -> { if ( this . task == null ) { return false ; } final var attributes = new JsonObject ( ) . put ( "question" , this . task . goal . name ) . put ( "taskId" , this . task . id ) . put ( "userId" , this . task . requesterId ) . put ( "sensitive" , this . task . attributes . getBoolean ( "sensitive" ) ) . put ( "anonymous" , this . task . attributes . getBoolean ( "anonymous" ) ) . put ( "positionOfAnswerer" , this . task . attributes . getString ( "positionOfAnswerer" ) ) ; return MessagePredicates . attributesSimilarTo ( attributes ) . test ( target ) ; } ) ; }
Create a predicate that check that the specified user receive the question to
 answer.
Create a predicate that check that the specified user receive the question to answer .