public void acceptRow(final List<?> key, final GenericRow value) {
    try {
      if (passedLimit()) {
        return;
      }

      final KeyValue<List<?>, GenericRow> row = keyValue(key, value);
      final KeyValueMetadata<List<?>, GenericRow> keyValueMetadata = new KeyValueMetadata<>(row);

      while (!closed) {
        if (rowQueue.offer(keyValueMetadata, offerTimeoutMs, TimeUnit.MILLISECONDS)) {
          onQueued();
          totalRowsQueued.incrementAndGet();
          break;
        }
      }
    } catch (final InterruptedException e) {
      // Forced shutdown?
      Thread.currentThread().interrupt();
    }
  }
@Test
  public void shouldCallLimitHandlerOnlyOnce() {
    // When:
    IntStream.range(0, SOME_LIMIT + 1)
        .forEach(idx -> queue.acceptRow(KEY_ONE, VAL_ONE));

    // Then:
    verify(limitHandler, times(1)).limitReached();
  }