Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for testPutIfAbsent (0.18 sec)

  1. android/guava-tests/test/com/google/common/collect/ForwardingConcurrentMapTest.java

        final ConcurrentMap<String, Integer> delegate = new ConcurrentHashMap<>();
    
        @Override
        protected ConcurrentMap<String, Integer> delegate() {
          return delegate;
        }
      }
    
      public void testPutIfAbsent() {
        TestMap map = new TestMap();
        map.put("foo", 1);
        assertEquals(Integer.valueOf(1), map.putIfAbsent("foo", 2));
        assertEquals(Integer.valueOf(1), map.get("foo"));
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Tue Oct 28 16:03:47 UTC 2025
    - 2.5K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/AtomicLongMapTest.java

        assertTrue(map.containsKey("2"));
        assertTrue(map.containsKey("3"));
        assertEquals(1L, map.get("1"));
        assertEquals(2L, map.get("2"));
        assertEquals(3L, map.get("3"));
      }
    
      public void testPutIfAbsent() {
        AtomicLongMap<String> map = AtomicLongMap.create();
        String key = "key";
        long newValue = random.nextInt(MAX_ADDEND);
        for (int i = 0; i < ITERATIONS; i++) {
          long before = map.get(key);
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 17.5K bytes
    - Viewed (0)
Back to top