@Test public void testEquals() { Assert.assertTrue(this.testInstance.equals(this.testInstance)); Assert.assertTrue(this.testInstance.equals(new SuggestedPhenotype(this.testID, this.testName, this.testScore))); Assert.assertFalse(this.testInstance.equals(null)); Assert.assertFalse(this.testInstance.equals(new Object())); SuggestedPhenotype instanceWithNullID = new SuggestedPhenotype(null, this.testName, this.testScore); Assert.assertFalse(instanceWithNullID.equals(this.testInstance)); Assert.assertFalse(this.testInstance.equals(instanceWithNullID)); Assert .assertFalse(this.testInstance.equals(new SuggestedPhenotype(this.otherID, this.testName, this.testScore))); Assert .assertFalse(this.testInstance.equals(new SuggestedPhenotype(this.testID, this.testName, this.otherScore))); Assert .assertTrue(this.testInstance.equals(new SuggestedPhenotype(this.testID, this.otherName, this.testScore))); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } SuggestedPhenotype other = (SuggestedPhenotype) obj; if (this.id == null) { if (other.id != null) { return false; } } else if (!this.id.equals(other.id)) { return false; } if (Double.doubleToLongBits(this.score) != Double.doubleToLongBits(other.score)) { return false; } return true; }
SuggestedPhenotype implements Comparable<SuggestedPhenotype> { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } SuggestedPhenotype other = (SuggestedPhenotype) obj; if (this.id == null) { if (other.id != null) { return false; } } else if (!this.id.equals(other.id)) { return false; } if (Double.doubleToLongBits(this.score) != Double.doubleToLongBits(other.score)) { return false; } return true; } }
SuggestedPhenotype implements Comparable<SuggestedPhenotype> { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } SuggestedPhenotype other = (SuggestedPhenotype) obj; if (this.id == null) { if (other.id != null) { return false; } } else if (!this.id.equals(other.id)) { return false; } if (Double.doubleToLongBits(this.score) != Double.doubleToLongBits(other.score)) { return false; } return true; } SuggestedPhenotype(String id, String name, double score); }
SuggestedPhenotype implements Comparable<SuggestedPhenotype> { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } SuggestedPhenotype other = (SuggestedPhenotype) obj; if (this.id == null) { if (other.id != null) { return false; } } else if (!this.id.equals(other.id)) { return false; } if (Double.doubleToLongBits(this.score) != Double.doubleToLongBits(other.score)) { return false; } return true; } SuggestedPhenotype(String id, String name, double score); String getId(); String getName(); double getScore(); @Override int compareTo(SuggestedPhenotype other); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
SuggestedPhenotype implements Comparable<SuggestedPhenotype> { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } SuggestedPhenotype other = (SuggestedPhenotype) obj; if (this.id == null) { if (other.id != null) { return false; } } else if (!this.id.equals(other.id)) { return false; } if (Double.doubleToLongBits(this.score) != Double.doubleToLongBits(other.score)) { return false; } return true; } SuggestedPhenotype(String id, String name, double score); String getId(); String getName(); double getScore(); @Override int compareTo(SuggestedPhenotype other); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }