class Worker {

  private final QueueManager queueManager;

  public Worker(QueueManager queueManager) {
    this.queueManager = queueManager;
  }

  /**
   * Keep checking queue for message.
   */
  @SuppressWarnings("squid:S2189")
  public void run() throws Exception {<FILL_FUNCTION_BODY>}

  /**
   * Process message.
   */
  private void processMessage(Message message) {
    LOGGER.info(message.toString());
  }

}

    while (true) {
      var message = queueManager.receiveMessage();
      if (message == null) {
        LOGGER.info("No Message ... waiting");
        Thread.sleep(200);
      } else {
        processMessage(message);
      }
    }
  
<no_super_class>