### Question:
ReadOnlyIndexReference extends IndexReference { @Override public synchronized void dispose() throws IOException { disposeSearcher(); } ReadOnlyIndexReference( IndexIdentifier identifier, IndexSearcher searcher ); @Override IndexWriter getWriter(); @Override synchronized void dispose(); @Override boolean checkAndClearStale(); @Override void setStale();  }### Answer:
@Test void disposeClosingSearcherAndMarkAsClosed() throws IOException { indexReference.dispose(); assertTrue( reader.isClosed() ); assertTrue( indexReference.isClosed() ); }