How to invoke/do timeout when read from stream ? I testing dbcp2 pool in jdbc in log4j appender and I need in unit test check that polls works. I try set sleep(5000) but no