code: public Message nextMessage(long timeout) throws MucNotJoinedException, InterruptedException {
          if (messageCollector == null) {
              throw new MucNotJoinedException(this);
          }
          return messageCollector.nextResult(timeout);
      }
docs: Returns the next available message in the chat. The method call will block
  (not return) until a stanza is available or the <tt>timeout</tt> has elapased.
  If the timeout elapses without a result, <tt>null</tt> will be returned.
  
  @param timeout the maximum amount of time to wait for the next message.
  @return the next message, or <tt>null</tt> if the timeout elapses without a
  message becoming available.
  @throws MucNotJoinedException
  @throws InterruptedException