### Question:
CacheStorageWriter { CachedLayer writeUncompressed(Blob uncompressedLayerBlob, @Nullable DescriptorDigest selector) throws IOException { Files.createDirectories(cacheStorageFiles.getLayersDirectory()); Files.createDirectories(cacheStorageFiles.getTemporaryDirectory()); try (TempDirectoryProvider tempDirectoryProvider = new TempDirectoryProvider()) { Path temporaryLayerDirectory = tempDirectoryProvider.newDirectory(cacheStorageFiles.getTemporaryDirectory()); WrittenLayer writtenLayer = writeUncompressedLayerBlobToDirectory(uncompressedLayerBlob, temporaryLayerDirectory); moveIfDoesNotExist( temporaryLayerDirectory, cacheStorageFiles.getLayerDirectory(writtenLayer.layerDigest)); Path layerFile = cacheStorageFiles.getLayerFile(writtenLayer.layerDigest, writtenLayer.layerDiffId); CachedLayer.Builder cachedLayerBuilder = CachedLayer.builder() .setLayerDigest(writtenLayer.layerDigest) .setLayerDiffId(writtenLayer.layerDiffId) .setLayerSize(writtenLayer.layerSize) .setLayerBlob(Blobs.from(layerFile)); if (selector != null) { writeSelector(selector, writtenLayer.layerDigest); } return cachedLayerBuilder.build(); } } CacheStorageWriter(CacheStorageFiles cacheStorageFiles);   }### Answer:
@Test public void testWriteUncompressed() throws IOException { Blob uncompressedLayerBlob = Blobs.from("uncompressedLayerBlob"); DescriptorDigest layerDigest = getDigest(compress(uncompressedLayerBlob)).getDigest(); DescriptorDigest selector = getDigest(Blobs.from("selector")).getDigest(); CachedLayer cachedLayer = cacheStorageWriter.writeUncompressed(uncompressedLayerBlob, selector); verifyCachedLayer(cachedLayer, uncompressedLayerBlob); Path selectorFile = cacheStorageFiles.getSelectorFile(selector); Assert.assertTrue(Files.exists(selectorFile)); Assert.assertEquals(layerDigest.getHash(), Blobs.writeToString(Blobs.from(selectorFile))); }