code: public void addSearch(Search<SolutionType> search) {
          // synchronize with status updates
          synchronized (getStatusLock()) {
              // assert idle
              assertIdle("Cannot add search to basic parallel search algorithm.");
              if (search.getProblem().equals(getProblem())) {
                  // listen to events fired by subsearch
                  search.addSearchListener(subsearchListener);
                  // add search
                  searches.add(search);
              } else {
                  throw new SearchException("Cannot add search " + search + " to basic parallel search algorithm " + this
                          + " (does not solve the same problem).");
              }
          }
      }
docs: <p>
  Add the given search, to be executed in parallel with the other searches. Only searches that solve
  the same problem as the one specified when creating the parallel search can be added. An exception
  will be thrown when attempting to add a search that solves a different problem. Note that this
  method may only be called when the search is idle.
  </p>
  <p>
  Because searches are executed in separate threads, it is important to ensure that any shared objects
  (problem, objective, constraints, neighbourhood, ...) are thread-safe.
  </p>
  
  @param search search to add for parallel execution
  @throws SearchException if the parallel search is not idle, or if the given search does not solve
  the same problem as the parallel search