@Override
                public void completed(final T storageObject) {
                    try {
                        if (storageObject != null) {
                            final HttpCacheStorageEntry entry = serializer.deserialize(storageObject);
                            if (key.equals(entry.getKey())) {
                                callback.completed(entry.getContent());
                            } else {
                                callback.completed(null);
                            }
                        } else {
                            callback.completed(null);
                        }
                    } catch (final Exception ex) {
                        callback.failed(ex);
                    }
                }
Abstract cache backend for serialized objects capable of CAS (compare-and-swap) updates.

@since 5.0
httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/AbstractSerializingAsyncCacheStorage.java