@Test
  public void testOnlineSlowLogRequestAttributes() throws Exception {
    Configuration conf = applySlowLogRecorderConf(1);
    Constructor<NamedQueueRecorder> constructor =
      NamedQueueRecorder.class.getDeclaredConstructor(Configuration.class);
    constructor.setAccessible(true);
    namedQueueRecorder = constructor.newInstance(conf);
    AdminProtos.SlowLogResponseRequest request =
      AdminProtos.SlowLogResponseRequest.newBuilder().setLimit(1).build();

    Assert.assertEquals(getSlowLogPayloads(request).size(), 0);
    LOG.debug("Initially ringbuffer of Slow Log records is empty");
    RpcLogDetails rpcLogDetails = getRpcLogDetailsOfScan();
    namedQueueRecorder.addRecord(rpcLogDetails);
    Assert.assertNotEquals(-1, HBASE_TESTING_UTILITY.waitFor(3000, () -> {
      Optional<SlowLogPayload> slowLogPayload = getSlowLogPayloads(request).stream().findAny();
      if (slowLogPayload.isPresent() && !slowLogPayload.get().getRequestAttributeList().isEmpty()) {
        return slowLogPayload.get().getRequestAttributeList().containsAll(REQUEST_HEADERS);
      }
      return false;
    }));
  }
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