@Override public synchronized void pause() {
    if ( !paused.getAndSet( true ) ) {
      try {
        assert acceptingRowsSemaphore.availablePermits() == 1;
        acceptingRowsSemaphore.acquire();
      } catch ( InterruptedException e ) {
        logChannel.logError( getString( PKG, "BlockingQueueStream.PauseInterrupt" ) );
      }
    }
  }
@Test
  @SuppressWarnings ( "unchecked" )
  public void errorLoggedIfInterruptedInPause() throws InterruptedException {
    streamSource.acceptingRowsSemaphore = semaphore;
    when( semaphore.availablePermits() ).thenReturn( 1 );
    streamSource.logChannel = logChannel;
    doThrow( new InterruptedException( "interrupt" ) )
      .when( semaphore ).acquire();
    streamSource.pause();
    verify( logChannel ).logError( any() );
  }