### Question:
DefaultDnsCnameCache implements DnsCnameCache { @Override public void clear() { cache.clear(); } DefaultDnsCnameCache();  DefaultDnsCnameCache(int minTtl, int maxTtl); @SuppressWarnings("unchecked") @Override String get(String hostname); @Override void cache(String hostname, String cname, long originalTtl, EventLoop loop); @Override void clear(); @Override boolean clear(String hostname);  }### Answer:
@Test public void testClear() throws Exception { EventLoopGroup group = new DefaultEventLoopGroup(1); try { EventLoop loop = group.next(); final DefaultDnsCnameCache cache = new DefaultDnsCnameCache(); cache.cache("x.netty.io", "mapping.netty.io", 100000, loop); cache.cache("y.netty.io", "mapping.netty.io", 100000, loop); assertEquals("mapping.netty.io", cache.get("x.netty.io")); assertEquals("mapping.netty.io", cache.get("y.netty.io")); assertTrue(cache.clear("x.netty.io")); assertNull(cache.get("x.netty.io")); assertEquals("mapping.netty.io", cache.get("y.netty.io")); cache.clear(); assertNull(cache.get("y.netty.io")); } finally { group.shutdownGracefully(); } }