### Question:
SolverExecutor extends RunnableBase { public void addProblemFactChanges(final List<ProblemFactChange<TaskAssigningSolution>> changes) { if (isStarted()) { solver.addProblemFactChanges(changes); } else { throw new SolverExecutorException("SolverExecutor has not been started. Be sure it's started and not stopped or destroyed prior to executing this method"); } } SolverExecutor(final SolverDef solverDef,
                          final KieServerRegistry registry,
                          final SolverEventListener<TaskAssigningSolution> eventListener); void start(final TaskAssigningSolution solution); boolean isStarted(); boolean isStopped(); void stop(); @Override void destroy(); void addProblemFactChanges(final List<ProblemFactChange<TaskAssigningSolution>> changes); @Override void run();  }### Answer:
@Test(timeout = TEST_TIMEOUT) public void addProblemFactChanges() throws Exception { CompletableFuture future = startRunnableBase(); runnableBase.start(solution); startFinished.await(); List<ProblemFactChange<TaskAssigningSolution>> changes = Collections.emptyList(); runnableBase.addProblemFactChanges(changes); verify(solver).addProblemFactChanges(changes); runnableBase.destroy(); future.get(); assertTrue(runnableBase.isDestroyed()); }
@Test public void addProblemFactChangesWithFailure() { List<ProblemFactChange<TaskAssigningSolution>> changes = Collections.emptyList(); Assertions.assertThatThrownBy(() -> runnableBase.addProblemFactChanges(changes)) .hasMessage("SolverExecutor has not been started. Be sure it's started and not stopped or destroyed prior to executing this method"); }