### Question:
DefaultCache implements Cache { public void flush() { cache = new HashMap<>(); } DefaultCache(); void flush(); Object put(String key, Object value); Object remove(String key); void delete(String key); Object get(String key); int getSize();  }### Answer:
@Test public void testFlush() { assertNull("String was not added", instance.put("testkey01", "testvalue01")); assertNull("String was not added", instance.put("testkey02", "testvalue02")); assertNull("String was not added", instance.put("testkey03", "testvalue03")); assertEquals("Cahce was not flushed", 3, instance.getSize()); instance.flush(); assertEquals("Cahce was not flushed", 0, instance.getSize()); }