@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()))); }
@Override public String toString() { return "HeroStat [strength=" + strength + ", intelligence=" + intelligence + ", luck=" + luck + "]"; }
HeroStat { @Override public String toString() { return "HeroStat [strength=" + strength + ", intelligence=" + intelligence + ", luck=" + luck + "]"; } }
HeroStat { @Override public String toString() { return "HeroStat [strength=" + strength + ", intelligence=" + intelligence + ", luck=" + luck + "]"; } private  HeroStat(int strength, int intelligence, int luck); }
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); }
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);  }