@Test
  public void testSlowLargeLogEvents() throws Exception {
    Configuration conf = applySlowLogRecorderConf(28);
    Constructor<NamedQueueRecorder> constructor =
      NamedQueueRecorder.class.getDeclaredConstructor(Configuration.class);
    constructor.setAccessible(true);
    namedQueueRecorder = constructor.newInstance(conf);

    AdminProtos.SlowLogResponseRequest request =
      AdminProtos.SlowLogResponseRequest.newBuilder().setLimit(14 * 11).build();

    Assert.assertEquals(getSlowLogPayloads(request).size(), 0);
    LOG.debug("Initially ringbuffer of Slow Log records is empty");

    boolean isSlowLog;
    boolean isLargeLog;
    for (int i = 0; i < 14 * 11; i++) {
      if (i % 2 == 0) {
        isSlowLog = true;
        isLargeLog = false;
      } else {
        isSlowLog = false;
        isLargeLog = true;
      }
      RpcLogDetails rpcLogDetails = getRpcLogDetails("userName_" + (i + 1), "client_" + (i + 1),
        "class_" + (i + 1), isSlowLog, isLargeLog);
      namedQueueRecorder.addRecord(rpcLogDetails);
    }
    LOG.debug("Added 14 * 11 records, ringbuffer should only provide latest 14 records");

    Assert.assertNotEquals(-1,
      HBASE_TESTING_UTILITY.waitFor(3000, () -> getSlowLogPayloads(request).size() == 14));

    Assert.assertNotEquals(-1, HBASE_TESTING_UTILITY.waitFor(3000, () -> {
      List<SlowLogPayload> slowLogPayloads = getSlowLogPayloads(request);

      // confirm strict order of slow log payloads
      return slowLogPayloads.size() == 14 && confirmPayloadParams(0, 153, slowLogPayloads)
        && confirmPayloadParams(1, 151, slowLogPayloads)
        && confirmPayloadParams(2, 149, slowLogPayloads)
        && confirmPayloadParams(3, 147, slowLogPayloads)
        && confirmPayloadParams(4, 145, slowLogPayloads)
        && confirmPayloadParams(5, 143, slowLogPayloads)
        && confirmPayloadParams(6, 141, slowLogPayloads)
        && confirmPayloadParams(7, 139, slowLogPayloads)
        && confirmPayloadParams(8, 137, slowLogPayloads)
        && confirmPayloadParams(9, 135, slowLogPayloads)
        && confirmPayloadParams(10, 133, slowLogPayloads)
        && confirmPayloadParams(11, 131, slowLogPayloads)
        && confirmPayloadParams(12, 129, slowLogPayloads)
        && confirmPayloadParams(13, 127, slowLogPayloads);
    }));

    AdminProtos.SlowLogResponseRequest largeLogRequest =
      AdminProtos.SlowLogResponseRequest.newBuilder().setLimit(14 * 11)
        .setLogType(AdminProtos.SlowLogResponseRequest.LogType.LARGE_LOG).build();

    Assert.assertNotEquals(-1,
      HBASE_TESTING_UTILITY.waitFor(3000, () -> getSlowLogPayloads(largeLogRequest).size() == 14));

    Assert.assertNotEquals(-1, HBASE_TESTING_UTILITY.waitFor(3000, () -> {
      List<SlowLogPayload> largeLogPayloads = getSlowLogPayloads(largeLogRequest);

      // confirm strict order of slow log payloads
      return largeLogPayloads.size() == 14 && confirmPayloadParams(0, 154, largeLogPayloads)
        && confirmPayloadParams(1, 152, largeLogPayloads)
        && confirmPayloadParams(2, 150, largeLogPayloads)
        && confirmPayloadParams(3, 148, largeLogPayloads)
        && confirmPayloadParams(4, 146, largeLogPayloads)
        && confirmPayloadParams(5, 144, largeLogPayloads)
        && confirmPayloadParams(6, 142, largeLogPayloads)
        && confirmPayloadParams(7, 140, largeLogPayloads)
        && confirmPayloadParams(8, 138, largeLogPayloads)
        && confirmPayloadParams(9, 136, largeLogPayloads)
        && confirmPayloadParams(10, 134, largeLogPayloads)
        && confirmPayloadParams(11, 132, largeLogPayloads)
        && confirmPayloadParams(12, 130, largeLogPayloads)
        && confirmPayloadParams(13, 128, largeLogPayloads);
    }));
  }
confirm that for a ringbuffer of slow logs, payload on given index of buffer has expected
elements
@param i               index of ringbuffer logs
@param j               data value that was put on index i
@param slowLogPayloads list of payload retrieved from {@link NamedQueueRecorder}
@return if actual values are as per expectations
hbase-server/src/test/java/org/apache/hadoop/hbase/namequeues/TestNamedQueueRecorder.java