### Question:
MulticastRegistry extends FailbackRegistry { @Override public void destroy() { super.destroy(); try { ExecutorUtil.cancelScheduledFuture(cleanFuture); } catch (Throwable t) { logger.warn(t.getMessage(), t); } try { multicastSocket.leaveGroup(multicastAddress); multicastSocket.close(); } catch (Throwable t) { logger.warn(t.getMessage(), t); } ExecutorUtil.gracefulShutdown(cleanExecutor, cleanPeriod); } MulticastRegistry(URL url); @Override void doRegister(URL url); @Override void doUnregister(URL url); @Override void doSubscribe(URL url, NotifyListener listener); @Override void doUnsubscribe(URL url, NotifyListener listener); @Override boolean isAvailable(); @Override void destroy(); @Override void register(URL url); @Override void unregister(URL url); @Override void subscribe(URL url, NotifyListener listener); @Override void unsubscribe(URL url, NotifyListener listener); @Override List<URL> lookup(URL url); MulticastSocket getMulticastSocket(); Map<URL, Set<URL>> getReceived();  }### Answer:
@Test public void testDestroy() { MulticastSocket socket = registry.getMulticastSocket(); assertFalse(socket.isClosed()); registry.destroy(); socket = registry.getMulticastSocket(); assertTrue(socket.isClosed()); }