code: public void setNeighbourhood(Neighbourhood<? super SolutionType> neighbourhood){
          // synchronize with status updates
          synchronized(getStatusLock()){
              // assert idle
              assertIdle("Cannot set neighbourhood.");
              // check not null
              if(neighbourhood == null){
                  throw new NullPointerException("Cannot set neighbourhood: received null.");
              }
              // go ahead
              this.neighbourhood = neighbourhood;
          }
      }
docs: Sets the neighbourhood used to modify the current solution. Note that <code>neighbourhood</code> can not be
  <code>null</code> and that this method may only be called when the search is idle.
  
  @throws NullPointerException if <code>neighbourhood</code> is <code>null</code>
  @throws SearchException if the search is currently not idle
  @param neighbourhood neighbourhood used to modify the current solution