Add a basic test case for the cache

This very basic test ensures that the useCache method works as
expected for simple scenarios. This test case fails without commit
a8795974051a91137b01ff88dbf5586a647b24ce and then also triggers the
warning that was introduced in bc2ddb548f71b1a822dd03c3bc7c3c0e7cd9b152