Improved test coverage of ThreadLocal