DagBuilder { public Dag build() { checkIsBuilt(); checkCircularDependencies(); this.isBuilt = true; return this.dag; } DagBuilder(final String name, final DagProcessor dagProcessor); Node createNode(final String name, final NodeProcessor nodeProcessor); void addParentNode(final String childNodeName, final String parentNodeName); Dag build(); @Override String toString();  }
@Test public void can_not_call_build_after_dag_already_built() { this.dagBuilder.build(); final Throwable thrown = catchThrowable(this.dagBuilder::build); assertThrownIsDagBuilderException(thrown); }