Attached a patch with a potential problem fix.
I could not reproduce the issue locally.
I believe that the only reason why this test failed is that the sequential invocations of Thread.sleep() caused current thread to sleep for more time than it was expected.
The total expected sleeping interval is 2500 mls.
It seems that for failed test the thread slept for more than 3000+ mls in total during first 2 sleep invocations and as result of it the counter peak value was evaluated due to finishing the sample period which is 1 second.
It seems that thread overslept for more than 500mls which is quite unexpected value. Perhaps, extra GC activity caused it. I am not sure.