### Question:
HeroStat { @Override public String toString() { return "HeroStat [strength=" + strength + ", intelligence=" + intelligence + ", luck=" + luck + "]"; } 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 testToString() { var heroStatA = HeroStat.valueOf(3, 9, 2); var heroStatB = HeroStat.valueOf(3, 9, 2); var heroStatC = HeroStat.valueOf(3, 9, 8); assertThat(heroStatA.toString(), is(heroStatB.toString())); assertThat(heroStatA.toString(), is(not(heroStatC.toString()))); }
@Test public void testToString() { HeroStat heroStatA = HeroStat.valueOf(3, 9, 2); HeroStat heroStatB = HeroStat.valueOf(3, 9, 2); HeroStat heroStatC = HeroStat.valueOf(3, 9, 8); assertThat(heroStatA.toString(), is(heroStatB.toString())); assertThat(heroStatA.toString(), is(not(heroStatC.toString()))); }