code: @SuppressWarnings("unchecked")
     public static <R> R snapshot(R ret) {
        if (ret instanceof EntryBackedReadWriteView) {
           EntryBackedReadWriteView view = (EntryBackedReadWriteView) ret;
           return (R) new ReadWriteSnapshotView(view.key(), view.find().orElse(null), view.entry.getMetadata());
        } else if (ret instanceof EntryAndPreviousReadWriteView) {
           EntryAndPreviousReadWriteView view = (EntryAndPreviousReadWriteView) ret;
           return (R) new ReadWriteSnapshotView(view.key(), view.getCurrentValue(), view.entry.getMetadata());
        } else if (ret instanceof EntryBackedReadOnlyView) {
           EntryBackedReadOnlyView view = (EntryBackedReadOnlyView) ret;
           return (R) new ReadOnlySnapshotView(view.key(), view.find().orElse(null), view.entry.getMetadata());
        } else if (ret instanceof NoValueReadOnlyView) {
           NoValueReadOnlyView view = (NoValueReadOnlyView) ret;
           return (R) new ReadOnlySnapshotView(view.key(), null, null);
        }
  
        return ret;
     }
docs: For convenience, a lambda might decide to return the entry view it received as parameter, because that makes easy
  to return both value and meta parameters back to the client.
  <p>
  If the lambda function decides to return an view, launder it into an immutable view to avoid the user trying apply
  any modifications to the entry view from outside the lambda function.
  <p>
  If the view is read-only, capture its data into a snapshot from the cached entry and avoid changing underneath.