@Test
public void testClear() throws Exception {

    final MemoryPersistentStore persistentStore = new MemoryPersistentStore();
    this.formatterCache = new FormatterCache(persistentStore, 100, 5000);
    final boolean hideWithheld = true;
    final long changeDate = new Date().getTime();
    final Key key = new Key(1, "eng", FormatType.html, "full_view", hideWithheld, FormatterWidth._100);
    final Key key2 = new Key(2, "eng", FormatType.html, "full_view", hideWithheld, FormatterWidth._100);
    formatterCache.get(key, new ChangeDateValidator(changeDate), new TestLoader("result", changeDate, false), true);
    formatterCache.get(key2, new ChangeDateValidator(changeDate), new TestLoader("result1", changeDate, false), true);
    formatterCache.clear();
    assertArrayEquals("newVal1".getBytes(Constants.CHARSET), formatterCache.get(key, new ChangeDateValidator(changeDate),
        new TestLoader("newVal1", changeDate, false), true));
    assertArrayEquals("newVal2".getBytes(Constants.CHARSET), formatterCache.get(key2, new ChangeDateValidator(changeDate),
        new TestLoader("newVal2", changeDate, false), true));
}