@Test
  public void testSlowLogFilterWithClientAddress() throws Exception {
    Configuration conf = applySlowLogRecorderConf(10);
    Constructor<NamedQueueRecorder> constructor =
      NamedQueueRecorder.class.getDeclaredConstructor(Configuration.class);
    constructor.setAccessible(true);
    namedQueueRecorder = constructor.newInstance(conf);
    AdminProtos.SlowLogResponseRequest request =
      AdminProtos.SlowLogResponseRequest.newBuilder().build();
    Assert.assertEquals(getSlowLogPayloads(request).size(), 0);

    String[] clientAddressArray = new String[] { "[127:1:1:1:1:1:1:1]:1", "[127:1:1:1:1:1:1:1]:2",
      "[127:1:1:1:1:1:1:1]:3", "127.0.0.1:1", "127.0.0.1:2" };
    boolean isSlowLog;
    boolean isLargeLog;
    for (int i = 0; i < 10; i++) {
      if (i % 2 == 0) {
        isSlowLog = true;
        isLargeLog = false;
      } else {
        isSlowLog = false;
        isLargeLog = true;
      }
      RpcLogDetails rpcLogDetails = getRpcLogDetails("userName_" + (i + 1),
        clientAddressArray[i % 5], "class_" + (i + 1), isSlowLog, isLargeLog);
      namedQueueRecorder.addRecord(rpcLogDetails);
    }

    AdminProtos.SlowLogResponseRequest largeLogRequestIPv6WithPort =
      AdminProtos.SlowLogResponseRequest.newBuilder()
        .setLogType(AdminProtos.SlowLogResponseRequest.LogType.LARGE_LOG)
        .setClientAddress("[127:1:1:1:1:1:1:1]:2").build();
    Assert.assertNotEquals(-1, HBASE_TESTING_UTILITY.waitFor(3000,
      () -> getSlowLogPayloads(largeLogRequestIPv6WithPort).size() == 1));
    AdminProtos.SlowLogResponseRequest largeLogRequestIPv6WithoutPort =
      AdminProtos.SlowLogResponseRequest.newBuilder()
        .setLogType(AdminProtos.SlowLogResponseRequest.LogType.LARGE_LOG)
        .setClientAddress("[127:1:1:1:1:1:1:1]").build();
    Assert.assertNotEquals(-1, HBASE_TESTING_UTILITY.waitFor(3000,
      () -> getSlowLogPayloads(largeLogRequestIPv6WithoutPort).size() == 3));
    AdminProtos.SlowLogResponseRequest largeLogRequestIPv4WithPort =
      AdminProtos.SlowLogResponseRequest.newBuilder()
        .setLogType(AdminProtos.SlowLogResponseRequest.LogType.LARGE_LOG)
        .setClientAddress("127.0.0.1:1").build();
    Assert.assertNotEquals(-1, HBASE_TESTING_UTILITY.waitFor(3000,
      () -> getSlowLogPayloads(largeLogRequestIPv4WithPort).size() == 1));
    AdminProtos.SlowLogResponseRequest largeLogRequestIPv4WithoutPort =
      AdminProtos.SlowLogResponseRequest.newBuilder()
        .setLogType(AdminProtos.SlowLogResponseRequest.LogType.LARGE_LOG)
        .setClientAddress("127.0.0.1").build();
    Assert.assertNotEquals(-1, HBASE_TESTING_UTILITY.waitFor(3000,
      () -> getSlowLogPayloads(largeLogRequestIPv4WithoutPort).size() == 2));
  }
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