### Question:
ObjectCache { public @Nullable RevObject getIfPresent(ObjectId id) { return sharedCache.get().getIfPresent(keyPrefix.create(id)); } ObjectCache(Supplier<SharedCache> cache, CacheIdentifier prefix); boolean contains(ObjectId id); void invalidateAll(); void invalidate(ObjectId id); void put(RevObject obj); @Nullable RevObject getIfPresent(ObjectId id);  }### Answer:
public @Test void testGetIfPresent() { cache1.getIfPresent(o1.getId()); cache2.getIfPresent(o2.getId()); verify(mockSharedCache, times(1)).getIfPresent(eq(k11)); verify(mockSharedCache, times(1)).getIfPresent(eq(k22)); verifyNoMoreInteractions(mockSharedCache); }
public @Test void testUsesSupplier() { SharedCache sharedCacheOld = this.mockSharedCache; SharedCache sharedCacheNew = mock(SharedCache.class); cache1.getIfPresent(o1.getId()); this.mockSharedCache = sharedCacheNew; cache1.getIfPresent(o1.getId()); verify(sharedCacheOld, times(1)).getIfPresent(eq(k11)); verify(sharedCacheNew, times(1)).getIfPresent(eq(k11)); verifyNoMoreInteractions(mockSharedCache); }