@Test public void testSelfCycles2() { Requirement self = new Requirement(null); thrown.expect(RuntimeException.class); thrown.expectMessage("Requirement cycle detected"); self.setRequiredBy(self); }
public void setRequiredBy(Requirement<T> req) { req.setRequires(this); }
Requirement { public void setRequiredBy(Requirement<T> req) { req.setRequires(this); } }
Requirement { public void setRequiredBy(Requirement<T> req) { req.setRequires(this); } Requirement(T data); }
Requirement { public void setRequiredBy(Requirement<T> req) { req.setRequires(this); } Requirement(T data); T getData(); void setRequires(Requirement<T> req); void setRequiredBy(Requirement<T> req); boolean requires(Requirement<T> req); boolean requiredBy(Requirement<T> req); Collection<Requirement<T>> listRequirements(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); String toStringWithReqs(); }
Requirement { public void setRequiredBy(Requirement<T> req) { req.setRequires(this); } Requirement(T data); T getData(); void setRequires(Requirement<T> req); void setRequiredBy(Requirement<T> req); boolean requires(Requirement<T> req); boolean requiredBy(Requirement<T> req); Collection<Requirement<T>> listRequirements(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); String toStringWithReqs();  }