Caching the Inverse of a Matrix + test case