write method
Writes a cache entry with the given key.
Implementation
@override
Future<void> write(String key, CacheEntry entry) async {
writeCount++;
_writeKeys.add(key);
if (writeDelay != null) await Future<void>.delayed(writeDelay!);
if (writeError != null) throw writeError!;
_data[key] = entry;
}