@Test
public void testIndexWritingAndFinding() throws IOException, InterruptedException {
verifyBoth(cache0, cache1);
IndexOutput indexOutput = dirA.createOutput(filename, IOContext.DEFAULT);
indexOutput.writeString("no need to write, nobody ever will read this");
indexOutput.close();
assertFileExistsHavingRLCount(filename, 1, true);
IndexInput openInput = dirB.openInput(filename, IOContext.DEFAULT);
assertFileExistsHavingRLCount(filename, 2, true);
dirA.deleteFile(filename);
assertFileExistsHavingRLCount(filename, 1, false);
IndexInput clone = (IndexInput) openInput.clone();
assertFileExistsHavingRLCount(filename, 1, false);
clone.close();
assertFileExistsHavingRLCount(filename, 1, false);
openInput.close();
assertFileNotExists(filename);
dirA.close();
dirB.close();
verifyBoth(cache0, cache1);
}