docs: @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;
     }