### Question:
ScriptExecutionAdderImpl implements ScriptExecutionAdder { @Override public void commit() { final ScriptExecutionCommand command = new ScriptExecutionCommand(scriptName, arguments, authenticate); if (!records.isEmpty()) { for (final Entry<String, Record> entry : records.entrySet()) { command.addWithReplace(entry.getKey(), entry.getValue()); } } queue.addInCclSessionCommand(command); } ScriptExecutionAdderImpl(final String scriptName, final CommandQueue queue); @Override void commit(); @Override ScriptExecutionAdder withReplace(final String recordName, final Record record); @Override ScriptExecutionAdder withArguments(final Argument... arguments); @Override ScriptExecutionAdder withAuthentication(final boolean authenticate);  }### Answer:
@Test public void testCommit() throws Exception { final CommandQueue queue = mock(CommandQueue.class); final ScriptExecutionCommand command = mock(ScriptExecutionCommand.class); whenNew(ScriptExecutionCommand.class).withArguments(THE_SCRIPT_NAME, Collections.<String> emptyList(), false) .thenReturn(command); adder = new ScriptExecutionAdderImpl(THE_SCRIPT_NAME, queue); adder.commit(); verify(queue).addInCclSessionCommand(command); }