Skip to content

Instantly share code, notes, and snippets.

@runeflobakk
Created August 23, 2011 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save runeflobakk/1166921 to your computer and use it in GitHub Desktop.
Save runeflobakk/1166921 to your computer and use it in GitHub Desktop.
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));
Relative nearbyRelative = nearbyRelatives.iterator().next();
assertThat(nearbyRelative.person, is(kari));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment