@Test public void shutsDownRepository() throws Exception { Repository repository = mock(Repository.class); CloseableRepository closeableRepository = new CloseableRepository(repository); closeableRepository.close(); verify(repository).shutDown(); }
@Override public void close() throws RepositoryException { repository.shutDown(); }
CloseableRepository implements AutoCloseable { @Override public void close() throws RepositoryException { repository.shutDown(); } }
CloseableRepository implements AutoCloseable { @Override public void close() throws RepositoryException { repository.shutDown(); } CloseableRepository(Repository repository); }
CloseableRepository implements AutoCloseable { @Override public void close() throws RepositoryException { repository.shutDown(); } CloseableRepository(Repository repository); Repository get(); @Override void close(); }
CloseableRepository implements AutoCloseable { @Override public void close() throws RepositoryException { repository.shutDown(); } CloseableRepository(Repository repository); Repository get(); @Override void close();  }