public Optional<CachedLayer> retrieve(ImmutableList<FileEntry> layerEntries)
      throws IOException, CacheCorruptedException {
    Optional<DescriptorDigest> optionalSelectedLayerDigest =
        cacheStorageReader.select(LayerEntriesSelector.generateSelector(layerEntries));
    if (!optionalSelectedLayerDigest.isPresent()) {
      return Optional.empty();
    }

    return cacheStorageReader.retrieve(optionalSelectedLayerDigest.get());
  }
Retrieves the {@link CachedLayer} that was built from the {@code layerEntries}.

@param layerEntries the layer entries to match against
@return a {@link CachedLayer} that was built from {@code layerEntries}, if found
@throws IOException if an I/O exception occurs
@throws CacheCorruptedException if the cache is corrupted
jib-core/src/main/java/com/google/cloud/tools/jib/cache/Cache.java