Triangle { public boolean equals(Object o) { if (!(o instanceof Triangle)) { return false; } Triangle t = (Triangle) o; return (s1 == t.s1 && s2 == t.s2 && s3 == t.s3); } Triangle(double side1, double side2, double side3); double getS1(); double getS2(); double getS3(); String getClassification(); double perimeter(); boolean equals(Object o); int hashCode(); String toString();  }
@Test public void equalsTest() { Triangle t1 = new Triangle(7, 10, 7); Triangle t2 = new Triangle(7, 10, 7); Assert.assertEquals("equals test", true, t1.equals(t2)); t2 = new Triangle(6, 10, 7); Assert.assertEquals("equals false test", false, t1.equals(t2)); t2 = new Triangle(7, 9, 7); Assert.assertEquals("equals false test", false, t1.equals(t2)); t2 = new Triangle(7, 10, 9); Assert.assertEquals("equals false test", false, t1.equals(t2)); Assert.assertEquals("equals false test", false, t1.equals("obj")); Assert.assertEquals("equals false test", false, t1.equals("obj")); Assert.assertEquals("equals false test", false, t1.equals("obj")); Assert.assertEquals("equals false test", 0, t1.hashCode()); }