docs: protected String consumeWord(ImapRequestLineReader request,
                                   CharacterValidator validator)
              throws ProtocolException {
          StringBuilder atom = new StringBuilder();
  
          char next = request.nextWordChar();
          while (!isWhitespace(next)) {
              if (validator.isValid(next)) {
                  atom.append(next);
                  request.consume();
              } else {
                  throw new ProtocolException("Invalid character: '" + next + '\'');
              }
              next = request.nextChar();
          }
          return atom.toString();
      }