Removing unused code in tests of cache