### Question:
CclScriptFactory implements DocumentedObjectFactory<CclScript, ScriptDocumentation> { @Override public CclScript build(final String objectName, final ScriptDocumentation topLevelDocumentation, final List<Subroutine> subroutines, final List<RecordStructure> recordStructures) { return new CclScript(objectName, topLevelDocumentation == null ? new ScriptDocumentation() : topLevelDocumentation, subroutines, recordStructures); }  @Override CclScript build(final String objectName, final ScriptDocumentation topLevelDocumentation,
            final List<Subroutine> subroutines, final List<RecordStructure> recordStructures);  }### Answer:
@Test public void testBuild() throws Exception { final ScriptDocumentation doc = mock(ScriptDocumentation.class); final CclScript script = mock(CclScript.class); whenNew(CclScript.class).withArguments(objectName, doc, subroutines, recordStructures).thenReturn(script); assertThat(factory.build(objectName, doc, subroutines, recordStructures)).isEqualTo(script); }
@Test public void testBuildNullDocumentation() throws Exception { final ScriptDocumentation doc = mock(ScriptDocumentation.class); whenNew(ScriptDocumentation.class).withNoArguments().thenReturn(doc); final CclScript script = mock(CclScript.class); whenNew(CclScript.class).withArguments(objectName, doc, subroutines, recordStructures).thenReturn(script); assertThat(factory.build(objectName, null, subroutines, recordStructures)).isEqualTo(script); }