docs: public int replaceIf(Predicate<Message> filter, Message replacement, boolean match_all) {
          if(filter == null)
              return 0;
          int matched=0;
          for(int i=0; i < index; i++) {
              if(filter.test(messages[i])) {
                  messages[i]=replacement;
                  matched++;
                  if(!match_all)
                      break;
              }
          }
          return matched;
      }