docs: private int findFileIndexAndUpdateCounter(String dateString) {
          if (dateString.equals(lastDateString)) {
              if (maxFiles <= 0) {
                  // addFile is a no-op, so it doesn't matter what we return.
                  return -1;
              }
  
              // Current date is the same, so the file goes at the end.
              return files.size();
          }
  
          // Use the new date string.
          lastDateString = dateString;
          lastCounter = 0;
  
          if (maxFiles <= 0) {
              // addFile is a no-op, so it doesn't matter what we return.
              return -1;
          }
  
          if (files.isEmpty() || dateString.compareTo(lastDateString) > 0) {
              // Current date is newer, so the file goes at the end.
              return files.size();
          }
  
          // Current date is older, so determine where it goes.
          String partialFileName = fileName + dateString + '.';
          return -Collections.binarySearch(files, partialFileName, NaturalComparator.instance) - 1;
      }