### Question:
CacheStorageWriter { CachedLayer writeCompressed(Blob compressedLayerBlob) throws IOException { Files.createDirectories(cacheStorageFiles.getLayersDirectory()); Files.createDirectories(cacheStorageFiles.getTemporaryDirectory()); try (TempDirectoryProvider tempDirectoryProvider = new TempDirectoryProvider()) { Path temporaryLayerDirectory = tempDirectoryProvider.newDirectory(cacheStorageFiles.getTemporaryDirectory()); WrittenLayer writtenLayer = writeCompressedLayerBlobToDirectory(compressedLayerBlob, temporaryLayerDirectory); moveIfDoesNotExist( temporaryLayerDirectory, cacheStorageFiles.getLayerDirectory(writtenLayer.layerDigest)); Path layerFile = cacheStorageFiles.getLayerFile(writtenLayer.layerDigest, writtenLayer.layerDiffId); return CachedLayer.builder() .setLayerDigest(writtenLayer.layerDigest) .setLayerDiffId(writtenLayer.layerDiffId) .setLayerSize(writtenLayer.layerSize) .setLayerBlob(Blobs.from(layerFile)) .build(); } } CacheStorageWriter(CacheStorageFiles cacheStorageFiles);   }### Answer:
@Test public void testWriteCompressed() throws IOException { Blob uncompressedLayerBlob = Blobs.from("uncompressedLayerBlob"); CachedLayer cachedLayer = cacheStorageWriter.writeCompressed(compress(uncompressedLayerBlob)); verifyCachedLayer(cachedLayer, uncompressedLayerBlob); }