docs: void waitForQueueToDrain() {
          int remainingMessages = delayableImmutableMessages.size();
          logger.info("joynr message queue stopping. Contains {} remaining messages.", remainingMessages);
          if (remainingMessages > 0) {
              long shutdownStart = System.currentTimeMillis();
              while (System.currentTimeMillis() - shutdownStart < shutdownTimeoutMs) {
                  if (delayableImmutableMessages.size() == 0) {
                      break;
                  }
                  try {
                      Thread.sleep(5);
                  } catch (InterruptedException e) {
                      logger.error("Interrupted while waiting for joynr message queue to drain.");
                      e.printStackTrace();
                  }
              }
          }
          remainingMessages = delayableImmutableMessages.size();
          if (remainingMessages == 0) {
              logger.info("joynr message queue successfully emptied.");
          } else {
              logger.info("joynr message queue still contained " + remainingMessages + " messages at shutdown.");
          }
      }