public void importCounters(String[] counterNames, String[] counterKinds, long[] counterDeltas) {
    final int length = counterNames.length;
    if (counterKinds.length != length || counterDeltas.length != length) {
      throw new AssertionError("array lengths do not match");
    }
    for (int i = 0; i < length; ++i) {
      final CounterName name = CounterName.named(counterPrefix + counterNames[i]);
      final String kind = counterKinds[i];
      final long delta = counterDeltas[i];
      switch (kind) {
        case "sum":
          counterFactory.longSum(name).addValue(delta);
          break;
        case "max":
          counterFactory.longMax(name).addValue(delta);
          break;
        case "min":
          counterFactory.longMin(name).addValue(delta);
          break;
        default:
          throw new IllegalArgumentException("unsupported counter kind: " + kind);
      }
    }
  }
@Test
  public void testMultipleCounters() throws Exception {
    String[] names = {"sum_counter", "max_counter", "min_counter"};
    String[] kinds = {"sum", "max", "min"};
    long[] deltas = {100, 200, 300};
    counters.importCounters(names, kinds, deltas);
    Counter<Long, Long> sumCounter = getCounter("sum_counter");
    assertNotNull(sumCounter);

    counterSet.extractUpdates(false, mockUpdateExtractor);
    verify(mockUpdateExtractor)
        .longSum(named("stageName-systemName-dataset-sum_counter"), false, 100L);
    verify(mockUpdateExtractor)
        .longMax(named("stageName-systemName-dataset-max_counter"), false, 200L);
    verify(mockUpdateExtractor)
        .longMin(named("stageName-systemName-dataset-min_counter"), false, 300L);
    verifyNoMoreInteractions(mockUpdateExtractor);
  }