@Test
public void testCycles() {

    Requirement parent = new Requirement("parent");
    Requirement child1 = new Requirement("child1");
    Requirement child3 = new Requirement("child3");
    parent.setRequiredBy(child1);
    child1.setRequiredBy(child3);
    thrown.expect(RuntimeException.class);
    thrown.expectMessage("Requirement cycle detected");
    child3.setRequiredBy(parent);
}