code: protected void assertIdle(String errorMessage){
          // synchronize with status updates
          synchronized(statusLock){
              if(status != SearchStatus.IDLE){
                  // not idle, throw exception
                  throw new SearchException(errorMessage + " (current status: " + status  + "; required: IDLE)");
              }
          }
      }
docs: Asserts that the search is currently idle, more precisely that its status is equal to {@link SearchStatus#IDLE}.
  If not, a {@link SearchException} is thrown, which includes the given <code>errorMessage</code> and the current
  search status (different from IDLE).
  
  @param errorMessage message to be included in the {@link SearchException} thrown if the search is not idle
  @throws SearchException if the search is not idle