code: private File getFileForEvent(File collectionDir, Calendar timestamp) throws IOException {
          int counter = 0;
          File eventFile = getNextFileForEvent(collectionDir, timestamp, counter);
          while (eventFile.exists()) {
              eventFile = getNextFileForEvent(collectionDir, timestamp, counter);
              counter++;
          }
          return eventFile;
      }
docs: Gets the file to use for a new event in the given collection with the given timestamp. If
  there are multiple events with identical timestamps, this method will use a counter to
  create a unique file name for each.
  
  @param collectionDir The cache directory for the event collection.
  @param timestamp     The timestamp of the event.
  @return The file to use for the new event.