public synchronized void crash() throws IOException {
  openFiles=new HashMap<>();
  openFilesForWrite=new HashSet<>();
  openFilesDeleted=new HashSet<>();
  Map<Closeable,Exception> m=new IdentityHashMap<>(openFileHandles);
  for (  Closeable f : m.keySet()) {
    try {
      f.close();
    }
 catch (    Exception ignored) {
    }
  }
  corruptFiles(unSyncedFiles);
  crashed=true;
  unSyncedFiles=new HashSet<>();
}

public synchronized void crash ( ) throws IOException { openFiles = new HashMap < > ( ) ; openFilesForWrite = new HashSet < > ( ) ; openFilesDeleted = new HashSet < > ( ) ; Map < Closeable , Exception > m = new IdentityHashMap < > ( openFileHandles ) ; for ( Closeable f : m . keySet ( ) ) { try { f . close ( ) ; } catch ( Exception ignored ) { } } corruptFiles ( unSyncedFiles ) ; crashed = true ; unSyncedFiles = new HashSet < > ( ) ; }
simulates a crash of os or machine by overwriting unsynced files .
