### Question:
HeroStat { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } var other = (HeroStat) obj; if (intelligence != other.intelligence) { return false; } if (luck != other.luck) { return false; } return strength == other.strength; } private  HeroStat(int strength, int intelligence, int luck); static HeroStat valueOf(int strength, int intelligence, int luck); int getStrength(); int getIntelligence(); int getLuck(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testEquals() { var heroStatA = HeroStat.valueOf(3, 9, 2); var heroStatB = HeroStat.valueOf(3, 9, 2); new EqualsTester().addEqualityGroup(heroStatA, heroStatB).testEquals(); }