Example usage for java.util LinkedHashMap hashCode

List of usage examples for java.util LinkedHashMap hashCode

Introduction

In this page you can find the example usage for java.util LinkedHashMap hashCode.

Prototype

int hashCode();

Source Link

Document

Returns the hash code value for this map.

Usage

From source file:com.google.gwt.emultest.java.util.LinkedHashMapTest.java

public void testHashCode() {
    LinkedHashMap<String, String> hashMap = new LinkedHashMap<String, String>();
    checkEmptyLinkedHashMapAssumptions(hashMap);

    // Check that hashCode changes
    int hashCode1 = hashMap.hashCode();
    hashMap.put(KEY_KEY, VALUE_VAL);/*  ww  w  . j a  va2  s  .c o m*/
    int hashCode2 = hashMap.hashCode();

    assertTrue(hashCode1 != hashCode2);
}