*/
public void testPreserveAccessTimeMultipleReaders() throws Exception {
MockLastAccessReadonlyFile file =
new MockLastAccessReadonlyFile("file", true);
String path = file.getPath();
FileTime fileTime = file.getLastAccessTime();
assertNotNull(fileTime);
// We configured this to preserve LastAccessTime.
InputStream is1 = file.getInputStream();
InputStream is2 = file.getInputStream();
InputStream is3 = file.getInputStream();
// Reading should have changed the access time of the file.
assertFalse(fileTime.equals(file.getLastAccessTime()));
// Peek at the internal map of remembered access times.
List<FileTime> list = AccessTimePreservingReadonlyFile.map.get(path);
assertNotNull(list);
assertEquals(3, list.size());
// Closing the streams should restore the last access time
// to the original time.
is2.close();
assertTrue(fileTime.equals(file.getLastAccessTime()));
is1.close();
assertTrue(fileTime.equals(file.getLastAccessTime()));
is3.close();
assertTrue(fileTime.equals(file.getLastAccessTime()));
// We should be purged from the internal map of remembered access times.
list = AccessTimePreservingReadonlyFile.map.get(path);
assertNull(list);
}