Add unit tests for thread local cache.