code: public List<Command> getTopCommands(int count, String queueName)  {
          checkStarted();
          List<Command> res = new ArrayList<>();
  
          try(Session session = consumerConnection.createSession()) {
              Queue queue = (Queue) jmsServer.lookup(QUEUE_NAMESPACE + queueName);
              Enumeration messages = session.createBrowser(queue).getEnumeration();
              for(int i = 0; i < count && messages.hasMoreElements(); i++) {
                  Command command;
                  Message message = (Message) messages.nextElement();
                  if(binaryMode){
                      command = Command.fromBytes(getBytes((BytesMessage) message));
                  }else{
                      command = Command.fromXml(((TextMessage)message).getText());
                  }
                  command.setJMSMessageID(message.getJMSMessageID());
                  res.add(command);
              }
              return res;
          } catch (Exception e) {
              throw new AsyncException("Could not lookup commands", e);
          }
      }
docs: Returns top commands in queue. Does not remove anything from queue. This method can be used for
  an admin tool to peek inside the queue.
  
  @param count number of commands to lookup.
  @return top commands in queue or empty list is nothing is found in queue.