Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for testPutIfAbsent (0.28 sec)

  1. guava-testlib/src/com/google/common/collect/testing/testers/ConcurrentMapPutIfAbsentTester.java

      }
    
      @MapFeature.Require(SUPPORTS_PUT)
      public void testPutIfAbsent_supportedAbsent() {
        assertNull("putIfAbsent(notPresent, value) should return null", putIfAbsent(e3()));
        expectAdded(e3());
      }
    
      @MapFeature.Require(SUPPORTS_PUT)
      @CollectionSize.Require(absent = ZERO)
      public void testPutIfAbsent_supportedPresent() {
        assertEquals(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 4.8K bytes
    - Viewed (0)
  2. guava-testlib/src/com/google/common/collect/testing/testers/MapPutIfAbsentTester.java

      @MapFeature.Require(SUPPORTS_PUT)
      public void testPutIfAbsent_supportedAbsent() {
        assertNull(
            "putIfAbsent(notPresent, value) should return null", getMap().putIfAbsent(k3(), v3()));
        expectAdded(e3());
      }
    
      @MapFeature.Require(SUPPORTS_PUT)
      @CollectionSize.Require(absent = ZERO)
      public void testPutIfAbsent_supportedPresent() {
        assertEquals(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Jun 26 18:17:52 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  3. android/guava-testlib/src/com/google/common/collect/testing/testers/ConcurrentMapPutIfAbsentTester.java

      }
    
      @MapFeature.Require(SUPPORTS_PUT)
      public void testPutIfAbsent_supportedAbsent() {
        assertNull("putIfAbsent(notPresent, value) should return null", putIfAbsent(e3()));
        expectAdded(e3());
      }
    
      @MapFeature.Require(SUPPORTS_PUT)
      @CollectionSize.Require(absent = ZERO)
      public void testPutIfAbsent_supportedPresent() {
        assertEquals(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 4.8K bytes
    - Viewed (0)
  4. 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"));
        assertNull(map.putIfAbsent("bar", 3));
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.4K bytes
    - Viewed (0)
  5. 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);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 17.4K bytes
    - Viewed (0)
  6. 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"));
        assertNull(map.putIfAbsent("bar", 3));
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.4K bytes
    - Viewed (0)
  7. 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);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 17.4K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java

            warmed.add(entryOf(newKey, entry.getValue()));
          }
          assertEquals(WARMUP_SIZE, cache.stats().missCount());
          checkValidState(cache);
        }
      }
    
      public void testPutIfAbsent_populated() {
        for (LoadingCache<Object, Object> cache : caches()) {
          // don't let the entries get GCed
          List<Entry<Object, Object>> warmed = warmUp(cache);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 15K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/cache/PopulatedCachesTest.java

            warmed.add(entryOf(newKey, entry.getValue()));
          }
          assertEquals(WARMUP_SIZE, cache.stats().missCount());
          checkValidState(cache);
        }
      }
    
      public void testPutIfAbsent_populated() {
        for (LoadingCache<Object, Object> cache : caches()) {
          // don't let the entries get GCed
          List<Entry<Object, Object>> warmed = warmUp(cache);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 15K bytes
    - Viewed (0)
Back to top