@Test
public void testClientResponseStatsUpdate() throws IOException, InterruptedException, KeeperException {

    try (ZooKeeper zk = createClient()) {
        BufferStats clientResponseStats = serverFactory.getZooKeeperServer().serverStats().getClientResponseStats();
        assertThat("Last client response size should be initialized with INIT_VALUE",
                clientResponseStats.getLastBufferSize(), equalTo(BufferStats.INIT_VALUE));
        zk.create("/a", "test".getBytes(StandardCharsets.UTF_8), Ids.OPEN_ACL_UNSAFE,
                CreateMode.PERSISTENT);
        assertThat("Last client response size should be greater than 0 after client request was performed",
                clientResponseStats.getLastBufferSize(), greaterThan(0));
        byte[] contents = zk.getData("/a", null, null);
        assertArrayEquals("unexpected data", "test".getBytes(StandardCharsets.UTF_8), contents);
    }
}