@Test
  public void testCachingOperations() throws Exception {
    StoreKey storeKey0 = mock(StoreKey.class);
    StoreKey storeKey1 = mock(StoreKey.class);
    assertNotSame("storeKeys should not be equal", storeKey0, storeKey1);
    List<StoreKey> list = Arrays.asList(storeKey0, storeKey1);

    Map<StoreKey, StoreKey> convertedMap = storeKeyConverter.convert(list);
    assertEquals("Size of keys in input and output is different", list.size(), convertedMap.size());

    convertedMap = storeKeyConverter.convert(list);
    assertEquals("Size of keys in input and output is different", list.size(), convertedMap.size());

    storeKeyConverter.tryDropCache(list);

    try {
      StoreKey storeKey0Res = storeKeyConverter.getConverted(storeKey0);
      assertNotNull("Conversion of storeKey0 should not be null", storeKey0Res);
    } catch (Exception e) {
      fail("Exception thrown while storeKey0 is present");
    }

    storeKeyConverter.tryDropCache(list);
    try {
      storeKeyConverter.getConverted(storeKey0);
      fail("Get succeeded after cache is cleared");
    } catch (Exception e) {
      //expected
    }
  }
Testing caching logic by calling convert two time on a list of keys,
then try getting one of keys, then try removing these keys from cache,
then try getting these keys and then removing these keys again and try getting again
@throws Exception
ambry-commons/src/test/java/com/github/ambry/store/AbstractStoreKeyConverterTest.java