Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for testComputeIfAbsent (0.21 sec)

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

    @Ignore // Affects only Android test runner, which respects JUnit 4 annotations on JUnit 3 tests.
    public class MapComputeIfAbsentTester<K, V> extends AbstractMapTester<K, V> {
    
      @MapFeature.Require(SUPPORTS_PUT)
      public void testComputeIfAbsent_supportedAbsent() {
        assertEquals(
            "computeIfAbsent(notPresent, function) should return new value",
            v3(),
            getMap()
                .computeIfAbsent(
                    k3(),
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jan 09 20:10:38 GMT 2018
    - 6.4K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/cache/LocalCacheMapComputeTest.java

        super.setUp();
        this.cache =
            CacheBuilder.newBuilder()
                .expireAfterAccess(500000, TimeUnit.MILLISECONDS)
                .maximumSize(count)
                .build();
      }
    
      public void testComputeIfAbsent() {
        // simultaneous insertion for same key, expect 1 winner
        doParallelCacheOp(
            count,
            n -> {
              cache.asMap().computeIfAbsent(key, k -> "value" + n);
            });
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 6.3K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/cache/LocalCacheTest.java

        map.put("quux", "quux");
        assertFalse(map.values() instanceof Set);
        assertTrue(map.values().removeAll(ImmutableSet.of("bar")));
        assertEquals(1, map.size());
      }
    
      public void testComputeIfAbsent_RemovalListener() {
        List<RemovalNotification<Object, Object>> notifications = new ArrayList<>();
        RemovalListener<Object, Object> removalListener =
            new RemovalListener<Object, Object>() {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Mar 14 23:06:48 GMT 2024
    - 112.3K bytes
    - Viewed (0)
Back to top