private RFuture<Boolean> trySet(V newValue, BucketTrySetOperation operation) {
        checkState();
        return executeLocked(() -> {
            if (state != null) {
                operations.add(operation);
                if (state == NULL) {
                    state = Optional.ofNullable((Object) newValue).orElse(NULL);
                    hasExpiration = operation.getTimeUnit() != null;
                    return CompletableFuture.completedFuture(true);
                } else {
                    return CompletableFuture.completedFuture(false);
                }
            }

            return getAsync().thenApply(res -> {
                operations.add(operation);
                if (res == null) {
                    hasExpiration = operation.getTimeUnit() != null;
                    state = Optional.ofNullable((Object) newValue).orElse(NULL);
                    return true;
                }
                return false;
            });
        });
    }
@Test
    public void testTrySet() {
        RBucket<String> b = redisson.getBucket("test");
        b.set("123");
        
        RTransaction transaction = redisson.createTransaction(TransactionOptions.defaults());
        RBucket<String> bucket = transaction.getBucket("test");
        assertThat(bucket.trySet("0")).isFalse();
        assertThat(bucket.delete()).isTrue();
        assertThat(bucket.trySet("324")).isTrue();
        assertThat(bucket.trySet("43")).isFalse();
        
        transaction.commit();
        
        assertThat(redisson.getKeys().count()).isEqualTo(1);
        assertThat(b.get()).isEqualTo("324");
    }