@Nullable
  public File beginPut(String key) {
    long startTime = getLogTime();
    openIfNotOpen();
    verifyCanaryOrClear();
    EntryCache.Entry entry = entries.get(key);
    entry.acquireWriteLock();

    File permanentFile = getCacheFile(key);
    if (fileSystem.exists(permanentFile)) {
      return null;
    }

    File result = getTempFile(key);
    if (LOG_VERBOSE) {
      Log.v(TAG, "Completed begin put in: " + getElapsedTime(startTime) + ", key: " + key);
    }
    return result;
  }
@Test
  public void beginPut_createsCanaryFile() {
    cache.beginPut("key");
    assertThat(cacheDir.listFiles()).hasLength(1);
  }