code: public void addSearchListener(SearchListener<? super SolutionType> listener){
          // acquire status lock
          synchronized(statusLock){
              // assert idle
              assertIdle("Cannot add search listener.");
              // add listener
              searchListeners.add(listener);
              // log
              LOGGER.debug("{}: added search listener {}", this, listener);
          }
      }
docs: Add a search listener. Any search listener with a matching solution type (or a more general solution type)
  may be added. Note that this method can only be called when the search is idle.
  
  @param listener search listener to add to the search
  @throws SearchException if the search is not idle