Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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));
- }
Add Comment
Please, Sign In to add comment