@Override
    public V getAndSet(V newValue) {
        return get(getAndSetAsync(newValue));
    }
@Test
    public void testGetAndSet() {
        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);

        NestedType nt2 = new NestedType();
        nt2.setValue(124);
        nt2.setValues(Arrays.asList("t4", "t3"));
        NestedType cv = al.getAndSet(new JacksonCodec<>(NestedType.class), "type", nt2);
        assertThat(cv.getValue()).isEqualTo(nt.getValue());
        assertThat(cv.getValues()).isEqualTo(nt.getValues());

        NestedType nt3 = al.get(new JacksonCodec<>(NestedType.class), "type");
        assertThat(nt3.getValue()).isEqualTo(nt2.getValue());
        assertThat(nt3.getValues()).isEqualTo(nt2.getValues());
    }