Example usage for org.jfree.data.time Millisecond hashCode

List of usage examples for org.jfree.data.time Millisecond hashCode

Introduction

In this page you can find the example usage for org.jfree.data.time Millisecond hashCode.

Prototype

@Override
public int hashCode() 

Source Link

Document

Returns a hash code for this object instance.

Usage

From source file:org.jfree.data.time.MillisecondTest.java

/**
 * Two objects that are equal are required to return the same hashCode.
 *///from  w  ww.j  av  a  2 s  . c  om
@Test
public void testHashcode() {
    Millisecond m1 = new Millisecond(599, 23, 45, 7, 9, 10, 2007);
    Millisecond m2 = new Millisecond(599, 23, 45, 7, 9, 10, 2007);
    assertTrue(m1.equals(m2));
    int hash1 = m1.hashCode();
    int hash2 = m2.hashCode();
    assertEquals(hash1, hash2);
}

From source file:org.jfree.data.time.junit.MillisecondTest.java

/**
 * Two objects that are equal are required to return the same hashCode.
 *//*from w w w.  jav  a2 s  .  c om*/
public void testHashcode() {
    Millisecond m1 = new Millisecond(599, 23, 45, 7, 9, 10, 2007);
    Millisecond m2 = new Millisecond(599, 23, 45, 7, 9, 10, 2007);
    assertTrue(m1.equals(m2));
    int hash1 = m1.hashCode();
    int hash2 = m2.hashCode();
    assertEquals(hash1, hash2);
}