### Question:
BaseCclExecutor extends CclExecutor { @Override public ScriptExecutionAdder addScriptExecution(final String scriptName) { if (scriptName == null) throw new NullPointerException("Script name cannot be null."); if (StringUtils.isEmpty(scriptName)) throw new IllegalArgumentException("Script name cannot be blank."); return new ScriptExecutionAdderImpl(scriptName, getCommandQueue()); } BaseCclExecutor();  BaseCclExecutor(final TerminalProperties terminalProperties, final CommandQueue commandQueue); @Override DynamicCompilerAdderImpl addDynamicCompiler(final File includeFile); @Override ScriptCompilerAdderImpl addScriptCompiler(final File file); @Override ScriptDropAdder addScriptDropper(final String scriptName); @Override ScriptExecutionAdder addScriptExecution(final String scriptName); @Override void execute(); @Override void setOutputStream(final OutputStream stream, final OutputType outputType); @Override void setTerminalProperties(final TerminalProperties terminalProperties);  }### Answer:
@Test public void testAddScriptExecution() throws Exception { final String scriptName = "a script"; final ScriptExecutionAdderImpl adder = mock(ScriptExecutionAdderImpl.class); whenNew(ScriptExecutionAdderImpl.class).withArguments(scriptName, queue).thenReturn(adder); assertThat(executor.addScriptExecution(scriptName)).isEqualTo(adder); }
@Test public void testAddScriptExecutionBlankName() { IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> { executor.addScriptExecution(""); }); assertThat(e.getMessage()).isEqualTo("Script name cannot be blank."); }
@Test public void testAddScriptExecutionNullName() { NullPointerException e = assertThrows(NullPointerException.class, () -> { executor.addScriptExecution(null); }); assertThat(e.getMessage()).isEqualTo("Script name cannot be null."); }