FileTypeAttribute { @Override public boolean equals(Object obj){ if (this == obj) return true; if (obj == null) return false; if (!this.getClass().isInstance(obj) && !obj.getClass().isInstance(this)) return false; return attrName.equals(obj.toString()); } FileTypeAttribute(String attrName); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test (groups = "unit-tests") public void testEquals() { Assert.assertTrue(fta1.equals(fta2)); Assert.assertTrue(fta2.equals(fta1)); Assert.assertFalse(fta1.equals(fta3)); Assert.assertFalse(fta2.equals(fta3)); }