class HazelcastLockBasedProxyManager<K> extends AbstractLockBasedProxyManager<K> {

    private final IMap<K, byte[]> map;

    public HazelcastLockBasedProxyManager(IMap<K, byte[]> map) {
        this(map, ClientSideConfig.getDefault());
    }

    public HazelcastLockBasedProxyManager(IMap<K, byte[]> map, ClientSideConfig clientSideConfig) {
        super(clientSideConfig);
        this.map = Objects.requireNonNull(map);
    }

    @Override
    public void removeProxy(K key) {
        map.remove(key);
    }

    @Override
    public boolean isAsyncModeSupported() {
        // Because Hazelcast IMap does not provide "lockAsync" API.
        return false;
    }

    @Override
    public boolean isExpireAfterWriteSupported() {
        return true;
    }

    @Override
    protected LockBasedTransaction allocateTransaction(K key, Optional<Long> requestTimeout) {<FILL_FUNCTION_BODY>}

}

        return new LockBasedTransaction() {

            @Override
            public void begin(Optional<Long> requestTimeout) {
                // do nothing
            }

            @Override
            public void rollback() {
                // do nothing
            }

            @Override
            public void commit(Optional<Long> requestTimeout) {
                // do nothing
            }

            @Override
            public byte[] lockAndGet(Optional<Long> requestTimeout) {
                map.lock(key);
                return map.get(key);
            }

            @Override
            public void unlock() {
                map.unlock(key);
            }

            @Override
            public void create(byte[] data, RemoteBucketState newState, Optional<Long> requestTimeout) {
                save(data, newState);
            }

            @Override
            public void update(byte[] data, RemoteBucketState newState, Optional<Long> requestTimeout) {
                save(data, newState);
            }

            private void save(byte[] data, RemoteBucketState newState) {
                ExpirationAfterWriteStrategy expiration = getClientSideConfig().getExpirationAfterWriteStrategy().orElse(null);
                if (expiration == null) {
                    map.put(key, data);
                } else {
                    long currentTimeNanos = getClientSideConfig().getClientSideClock().orElse(TimeMeter.SYSTEM_MILLISECONDS).currentTimeNanos();
                    long ttlMillis = expiration.calculateTimeToLiveMillis(newState, currentTimeNanos);
                    if (ttlMillis > 0) {
                        map.put(key, data, ttlMillis, TimeUnit.MILLISECONDS);
                    } else {
                        map.put(key, data);
                    }
                }
            }

            @Override
            public void release() {
                // do nothing
            }
        };
    
<methods>public CommandResult<T> execute(K, Request<T>) ,public CompletableFuture<CommandResult<T>> executeAsync(K, Request<T>) ,public boolean isAsyncModeSupported() <variables>