@Test
@Transactional
public void testSetOneToManyRelationship() {
Person michael = persistedPerson("Michael", 35);
Person david = persistedPerson("David", 25);
Group group = persist(new Group());
Set<Person> persons = new HashSet<Person>(Arrays.asList(michael, david));
group.setPersons(persons);
Relationship michaelRel = getNodeState(michael).getSingleRelationship(DynamicRelationshipType.withName("persons"), Direction.INCOMING);
Relationship davidRel = getNodeState(david).getSingleRelationship(DynamicRelationshipType.withName("persons"), Direction.INCOMING);
assertEquals(getNodeState(group), michaelRel.getStartNode());
assertEquals(getNodeState(group), davidRel.getStartNode());
}