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

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

Introduction

In this page you can find the example usage for org.jfree.data.time SimpleTimePeriod 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.SimpleTimePeriodTest.java

/**
 * Two objects that are equal are required to return the same hashCode.
 *//* w  w w . j a va  2s .  com*/
@Test
public void testHashcode() {
    SimpleTimePeriod s1 = new SimpleTimePeriod(new Date(10L), new Date(20L));
    SimpleTimePeriod s2 = new SimpleTimePeriod(new Date(10L), new Date(20L));
    assertTrue(s1.equals(s2));
    int h1 = s1.hashCode();
    int h2 = s2.hashCode();
    assertEquals(h1, h2);
}