@Override
    public boolean compareAndSet(V expect, V update) {
        return get(compareAndSetAsync(expect, update));
    }
@Test
    public void testCompareAndSet() {
        RJsonBucket<TestType> al = redisson.getJsonBucket("test", new JacksonCodec<>(TestType.class));
        TestType t = new TestType();
        t.setName("name1");
        al.set(t);

        NestedType nt = new NestedType();
        nt.setValue(123);
        nt.setValues(Arrays.asList("t1", "t2"));
        al.set("$.type", nt);

        nt = al.get(new JacksonCodec<>(NestedType.class), "type");

        NestedType nt2 = new NestedType();
        nt2.setValue(124);
        nt2.setValues(Arrays.asList("t4", "t3"));
        assertThat(al.compareAndSet("$.type", null, nt2)).isFalse();
        assertThat(al.compareAndSet("$.type", nt, nt2)).isTrue();

        Integer n2 = al.get(new JacksonCodec<>(Integer.class), "type.value");
        assertThat(n2).isEqualTo(124);

        List<String> v1 = Arrays.asList("t4", "t3");
        List<String> v2 = Arrays.asList("t5", "t6");
        assertThat(al.compareAndSet("type.values", v1, v2)).isTrue();

        List<List<String>> n3 = al.get(new JacksonCodec<>(new TypeReference<List<List<String>>>(){}), "$.type.values");
        assertThat(n3.get(0)).containsExactly("t5", "t6");
    }