@Test public void testObjectEqualsPerformance() { StopWatch stopWatch = new StopWatch(); stopWatch.getElapsedTime(); Object object = new Object(); for (int i = 0; i < 10000; i++) { status1.equals(object); } stopWatch.getElapsedTime(); for (int i = 0; i < 10000; i++) { status1.equals(object); } long objectCompareTime = stopWatch.getElapsedTime(); LOG.info("Time to do equals(Object): " + objectCompareTime); assertTrue("Status compare is greater than permitted time", objectCompareTime < 25); }
public boolean equals(Object object) { if (!(object instanceof Status)) { return false; } return ((Status) object).intValue == intValue; }
Status implements Serializable { public boolean equals(Object object) { if (!(object instanceof Status)) { return false; } return ((Status) object).intValue == intValue; } }
Status implements Serializable { public boolean equals(Object object) { if (!(object instanceof Status)) { return false; } return ((Status) object).intValue == intValue; } private  Status(int intValue, String name); }
Status implements Serializable { public boolean equals(Object object) { if (!(object instanceof Status)) { return false; } return ((Status) object).intValue == intValue; } private  Status(int intValue, String name); String toString(); static Status convertIntToStatus(int statusAsInt); int intValue(); boolean equals(Object object); boolean equals(Status status); int hashCode(); }
Status implements Serializable { public boolean equals(Object object) { if (!(object instanceof Status)) { return false; } return ((Status) object).intValue == intValue; } private  Status(int intValue, String name); String toString(); static Status convertIntToStatus(int statusAsInt); int intValue(); boolean equals(Object object); boolean equals(Status status); int hashCode(); static final Status STATUS_UNINITIALISED; static final Status STATUS_ALIVE; static final Status STATUS_SHUTDOWN; }