@Override
    public V putIfAbsent(K key, V value, Duration ttl) {
        return get(putIfAbsentAsync(key, value, ttl));
    }
@Test
    public void testAddAndGetTTL() {
        RMapCacheNative<String, Object> mapCache = redisson.getMapCacheNative("test_put_if_absent", LongCodec.INSTANCE);
        assertThat(mapCache.putIfAbsent("4", 0L, Duration.ofSeconds(10000))).isNull();
        assertThat(mapCache.addAndGet("4", 1L)).isEqualTo(1L);
        assertThat(mapCache.putIfAbsent("4", 0L)).isEqualTo(1L);
        assertThat(mapCache.addAndGet("key", Long.MAX_VALUE-10)).isEqualTo(Long.MAX_VALUE-10);
        assertThat(mapCache.addAndGet("key", 10L)).isEqualTo(Long.MAX_VALUE);
        Assertions.assertEquals(1L, mapCache.get("4"));
        mapCache.destroy();
        mapCache = redisson.getMapCacheNative("test_put_if_absent_1", LongCodec.INSTANCE);
        mapCache.putIfAbsent("4", 0L);
        mapCache.addAndGet("4", 1L);
        mapCache.putIfAbsent("4", 0L);
        Assertions.assertEquals(1L, mapCache.get("4"));
        RMap map = redisson.getMap("test_put_if_absent_2", LongCodec.INSTANCE);
        map.putIfAbsent("4", 0L);
        map.addAndGet("4", 1L);
        map.putIfAbsent("4", 0L);
        Assertions.assertEquals(1L, map.get("4"));
        RMapCacheNative<String, Object> mapCache1 = redisson.getMapCacheNative("test_put_if_absent_3", DoubleCodec.INSTANCE);
        mapCache1.putIfAbsent("4", 1.23, Duration.ofSeconds(10000));
        mapCache1.addAndGet("4", 1D);
        Assertions.assertEquals(2.23, mapCache1.get("4"));
        mapCache.destroy();
        mapCache1.destroy();
    }