Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for ExpectedHashCode (0.09 sec)

  1. guava-tests/test/com/google/common/hash/HashCodeTest.java

      }
    
      private static void assertExpectedHashCode(ExpectedHashCode expectedHashCode, HashCode hash) {
        assertTrue(Arrays.equals(expectedHashCode.bytes, hash.asBytes()));
        byte[] bb = new byte[hash.bits() / 8];
        hash.writeBytesTo(bb, 0, bb.length);
        assertTrue(Arrays.equals(expectedHashCode.bytes, bb));
        assertEquals(expectedHashCode.asInt, hash.asInt());
        if (expectedHashCode.asLong == null) {
          try {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 21 14:28:19 UTC 2024
    - 13.1K bytes
    - Viewed (0)
  2. android/guava-testlib/src/com/google/common/collect/testing/testers/SetHashCodeTester.java

    public class SetHashCodeTester<E> extends AbstractSetTester<E> {
      public void testHashCode() {
        int expectedHashCode = 0;
        for (E element : getSampleElements()) {
          expectedHashCode += ((element == null) ? 0 : element.hashCode());
        }
        assertEquals(
            "A Set's hashCode() should be the sum of those of its elements.",
            expectedHashCode,
            getSet().hashCode());
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 3K bytes
    - Viewed (0)
  3. guava-testlib/src/com/google/common/collect/testing/testers/MapHashCodeTester.java

    public class MapHashCodeTester<K, V> extends AbstractMapTester<K, V> {
      public void testHashCode() {
        int expectedHashCode = 0;
        for (Entry<K, V> entry : getSampleEntries()) {
          expectedHashCode += hash(entry);
        }
        assertEquals(
            "A Map's hashCode() should be the sum of those of its entries.",
            expectedHashCode,
            getMap().hashCode());
      }
    
      @CollectionSize.Require(absent = CollectionSize.ZERO)
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Jul 24 20:12:35 UTC 2024
    - 3K bytes
    - Viewed (0)
  4. guava-testlib/src/com/google/common/collect/testing/testers/SetHashCodeTester.java

    public class SetHashCodeTester<E> extends AbstractSetTester<E> {
      public void testHashCode() {
        int expectedHashCode = 0;
        for (E element : getSampleElements()) {
          expectedHashCode += ((element == null) ? 0 : element.hashCode());
        }
        assertEquals(
            "A Set's hashCode() should be the sum of those of its elements.",
            expectedHashCode,
            getSet().hashCode());
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 3K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/hash/HashCodeTest.java

      }
    
      private static void assertExpectedHashCode(ExpectedHashCode expectedHashCode, HashCode hash) {
        assertTrue(Arrays.equals(expectedHashCode.bytes, hash.asBytes()));
        byte[] bb = new byte[hash.bits() / 8];
        hash.writeBytesTo(bb, 0, bb.length);
        assertTrue(Arrays.equals(expectedHashCode.bytes, bb));
        assertEquals(expectedHashCode.asInt, hash.asInt());
        if (expectedHashCode.asLong == null) {
          try {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 21 14:28:19 UTC 2024
    - 13.1K bytes
    - Viewed (0)
  6. guava-testlib/src/com/google/common/collect/testing/testers/ListHashCodeTester.java

      public void testHashCode() {
        int expectedHashCode = 1;
        for (E element : getOrderedElements()) {
          expectedHashCode = 31 * expectedHashCode + ((element == null) ? 0 : element.hashCode());
        }
        assertEquals(
            "A List's hashCode() should be computed from those of its elements.",
            expectedHashCode,
            getList().hashCode());
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 2K bytes
    - Viewed (0)
  7. android/guava-testlib/src/com/google/common/collect/testing/testers/MapHashCodeTester.java

    public class MapHashCodeTester<K, V> extends AbstractMapTester<K, V> {
      public void testHashCode() {
        int expectedHashCode = 0;
        for (Entry<K, V> entry : getSampleEntries()) {
          expectedHashCode += hash(entry);
        }
        assertEquals(
            "A Map's hashCode() should be the sum of those of its entries.",
            expectedHashCode,
            getMap().hashCode());
      }
    
      @CollectionSize.Require(absent = CollectionSize.ZERO)
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Jul 24 20:12:35 UTC 2024
    - 3K bytes
    - Viewed (0)
  8. android/guava-testlib/src/com/google/common/collect/testing/testers/ListHashCodeTester.java

      public void testHashCode() {
        int expectedHashCode = 1;
        for (E element : getOrderedElements()) {
          expectedHashCode = 31 * expectedHashCode + ((element == null) ? 0 : element.hashCode());
        }
        assertEquals(
            "A List's hashCode() should be computed from those of its elements.",
            expectedHashCode,
            getList().hashCode());
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 2K bytes
    - Viewed (0)
Back to top