This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Person per = new Person("Per", new Address("A-gate 5", "0560", "Oslo"), 30); | |
private Person kari = new Person("Kari", new Address("B-gate 4", "0560", "Oslo"), 37); | |
@Test | |
public void knowsWhichRelativesLivingInTheSamePostalCode() { | |
per.relateTo(SIBLING, kari); | |
Collection<Relative> nearbyRelatives = per.getRelativesWithSamePostalCode(); | |
assertThat(nearbyRelatives, hasSize(1)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
${e:import(org.apache.commons.lang3.builder.EqualsBuilder)} | |
${h:import(org.apache.commons.lang3.builder.HashCodeBuilder)} | |
@Override | |
public boolean equals(Object object) { | |
if (object instanceof ${enclosing_type}) { | |
${enclosing_type} another = (${enclosing_type}) object; | |
return new EqualsBuilder().append(${replaceWithFieldName}, another.${replaceWithFieldName}).isEquals(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static boolean warnedAboutDevMode = false; | |
@Override | |
protected void outputDevelopmentModeWarning() { | |
if (warnedAboutDevMode) { | |
return; | |
} | |
super.outputDevelopmentModeWarning(); | |
warnedAboutDevMode = true; | |
} |
NewerOlder