Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 132 for 1003 (0.14 sec)

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

        HashBiMap<String, String> bimap = HashBiMap.create(map);
        assertEquals("dollar", bimap.get("canada"));
        assertEquals("canada", bimap.inverse().get("dollar"));
      }
    
      private static final int N = 1000;
    
      public void testBashIt() throws Exception {
        BiMap<Integer, Integer> bimap = HashBiMap.create(N);
        BiMap<Integer, Integer> inverse = bimap.inverse();
    
        for (int i = 0; i < N; i++) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Feb 19 20:34:55 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/math/IntMathTest.java

        // Defer correctness tests to Long.isPrime
    
        // Check the first 100,000 integers
        for (int i = 0; i < 100000; i++) {
          assertEquals(LongMath.isPrime(i), IntMath.isPrime(i));
        }
    
        // Then check 1000 deterministic pseudo-random int values.
        Random rand = new Random(1);
        for (int i = 0; i < 1000; i++) {
          int n = rand.nextInt(Integer.MAX_VALUE);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 07 17:50:39 GMT 2024
    - 24.5K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java

                  currentFuture.get().addListener(listener, executor);
                  return null;
                }
              });
        }
        assertEquals(allTasks.size() + 1, barrier.getParties());
        for (int i = 0; i < 1000; i++) {
          Collections.shuffle(allTasks);
          final AbstractFuture<String> future = new AbstractFuture<String>() {};
          currentFuture.set(future);
          for (Callable<?> task : allTasks) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 13 14:28:25 GMT 2024
    - 46.8K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/cache/CacheExpirationTest.java

                .ticker(ticker)
                .build(loader);
    
        // Increment 100 times
        for (int i = 0; i < 100; ++i) {
          cache.getUnchecked(10).incrementAndGet();
          ticker.advance(1, MILLISECONDS);
        }
    
        assertEquals(evictionCount.get() + 1, applyCount.get());
        int remaining = cache.getUnchecked(10).get();
        assertEquals(100, totalSum.get() + remaining);
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Aug 05 17:21:46 GMT 2022
    - 18.7K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/primitives/LongsTest.java

            .isEqualTo(0xFFEEDDCCBBAA9988L);
      }
    
      public void testByteArrayRoundTrips() {
        Random r = new Random(5);
        byte[] b = new byte[Longs.BYTES];
    
        for (int i = 0; i < 1000; i++) {
          long num = r.nextLong();
          assertThat(Longs.fromByteArray(Longs.toByteArray(num))).isEqualTo(num);
    
          r.nextBytes(b);
          long value = Longs.fromByteArray(b);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 30K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/collect/ListsTest.java

        assertEquals(89, Lists.computeArrayListCapacity(77));
        assertEquals(22000005, Lists.computeArrayListCapacity(20000000));
        assertEquals(Integer.MAX_VALUE, Lists.computeArrayListCapacity(Integer.MAX_VALUE - 1000));
      }
    
      public void testNewArrayListFromCollection() {
        ArrayList<Integer> list = Lists.newArrayList(SOME_COLLECTION);
        assertEquals(SOME_COLLECTION, list);
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Apr 17 16:33:44 GMT 2024
    - 35.2K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/primitives/LongsTest.java

            .isEqualTo(0xFFEEDDCCBBAA9988L);
      }
    
      public void testByteArrayRoundTrips() {
        Random r = new Random(5);
        byte[] b = new byte[Longs.BYTES];
    
        for (int i = 0; i < 1000; i++) {
          long num = r.nextLong();
          assertThat(Longs.fromByteArray(Longs.toByteArray(num))).isEqualTo(num);
    
          r.nextBytes(b);
          long value = Longs.fromByteArray(b);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 30K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/util/concurrent/RateLimiterTest.java

        assertEquals(0.2, limiter.acquire(), EPSILON);
      }
    
      public void testOneSecondBurst() {
        RateLimiter limiter = RateLimiter.create(5.0, stopwatch);
        stopwatch.sleepMillis(1000); // max capacity reached
        stopwatch.sleepMillis(1000); // this makes no difference
        limiter.acquire(1); // R0.00, since it's the first request
    
        limiter.acquire(1); // R0.00, from capacity
        limiter.acquire(3); // R0.00, from capacity
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.6K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/hash/Fingerprint2011Test.java

      // Length of the sample string to produce
      private static final int MAX_BYTES = 1000;
    
      // Map from sample string lengths to the fingerprint
      private static final ImmutableSortedMap<Integer, Long> LENGTH_FINGERPRINTS =
          new ImmutableSortedMap.Builder<Integer, Long>(Ordering.natural())
              .put(1000, 0x433109b33e13e6edL)
              .put(800, 0x5f2f123bfc815f81L)
              .put(640, 0x6396fc6a67293cf4L)
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Dec 29 14:55:25 GMT 2021
    - 7.6K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/cache/CacheBuilderGwtTest.java

        fakeTicker.advance(1000, TimeUnit.MILLISECONDS);
        assertEquals(null, cache.getIfPresent(0));
      }
    
      public void testExpireAfterWrite() {
        final Cache<Integer, Integer> cache =
            CacheBuilder.newBuilder()
                .expireAfterWrite(1000, TimeUnit.MILLISECONDS)
                .ticker(fakeTicker)
                .build();
    
        cache.put(10, 100);
        cache.put(20, 200);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Aug 05 17:21:46 GMT 2022
    - 15.1K bytes
    - Viewed (0)
Back to top