Example usage for org.jfree.data.time Quarter equals

List of usage examples for org.jfree.data.time Quarter equals

Introduction

In this page you can find the example usage for org.jfree.data.time Quarter equals.

Prototype

@Override
public boolean equals(Object obj) 

Source Link

Document

Tests the equality of this Quarter object to an arbitrary object.

Usage

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

/**
 * Check that a Quarter instance is equal to itself.
 *
 * SourceForge Bug ID: 558850./*from  w  w w  . j a v a2  s .  c  om*/
 */
@Test
public void testEqualsSelf() {
    Quarter quarter = new Quarter();
    assertTrue(quarter.equals(quarter));
}

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

/**
 * Tests the equals method.//from   ww  w  .j a v  a 2  s .co m
 */
@Test
public void testEquals() {
    Quarter q1 = new Quarter(2, 2002);
    Quarter q2 = new Quarter(2, 2002);
    assertTrue(q1.equals(q2));
}

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

/**
 * Two objects that are equal are required to return the same hashCode.
 *///from w w w  .  ja v  a  2  s  .  com
@Test
public void testHashcode() {
    Quarter q1 = new Quarter(2, 2003);
    Quarter q2 = new Quarter(2, 2003);
    assertTrue(q1.equals(q2));
    int h1 = q1.hashCode();
    int h2 = q2.hashCode();
    assertEquals(h1, h2);
}