@Test public void closeClosesDelegateAndInterruptsThreads() throws Exception { CleaningLeaseMaintainer cleaner = new CleaningLeaseMaintainer(delegate, connection, thread1, thread2); cleaner.close(); verify(delegate).close(); verify(thread1).close(); verify(thread2).close(); }
@Override public void close() throws IOException { closeResources(); delegate.close(); }
CleaningLeaseMaintainer implements LeaseMaintainer { @Override public void close() throws IOException { closeResources(); delegate.close(); } }
CleaningLeaseMaintainer implements LeaseMaintainer { @Override public void close() throws IOException { closeResources(); delegate.close(); } CleaningLeaseMaintainer(LeaseMaintainer delegate, Connection connection, Closeable... resources); private  CleaningLeaseMaintainer(LeaseMaintainer delegate, Connection connection, List<Closeable> resources); }
CleaningLeaseMaintainer implements LeaseMaintainer { @Override public void close() throws IOException { closeResources(); delegate.close(); } CleaningLeaseMaintainer(LeaseMaintainer delegate, Connection connection, Closeable... resources); private  CleaningLeaseMaintainer(LeaseMaintainer delegate, Connection connection, List<Closeable> resources); @Override Lease getCurrentLease(); @Override void waitForLease(); @Override boolean waitForLease(long timeout, TimeUnit timeUnit); @Override void close(); @Override void destroy(); }
CleaningLeaseMaintainer implements LeaseMaintainer { @Override public void close() throws IOException { closeResources(); delegate.close(); } CleaningLeaseMaintainer(LeaseMaintainer delegate, Connection connection, Closeable... resources); private  CleaningLeaseMaintainer(LeaseMaintainer delegate, Connection connection, List<Closeable> resources); @Override Lease getCurrentLease(); @Override void waitForLease(); @Override boolean waitForLease(long timeout, TimeUnit timeUnit); @Override void close(); @Override void destroy();  }