SyslogHosts implements Hosts { @Override public void close() throws IOException { this.hosts.close(); } SyslogHosts(final Hosts hsts); @Override void close(); @Override Host find(final String domain); @Override Set<Domain> domains(final User user);  }
@Test public void closesUnderlyingHosts() throws Exception { final Hosts hosts = Mockito.mock(Hosts.class); final SyslogHosts syslog = new SyslogHosts(hosts); syslog.close(); Mockito.verify(hosts, Mockito.only()).close(); }