public StatMap<K> merge(K key, int value) {
    if (key.getType() == Type.LONG) {
      merge(key, (long) value);
      return this;
    }
    int oldValue = getInt(key);
    int newValue = key.merge(oldValue, value);
    if (newValue == 0) {
      _map.remove(key);
    } else {
      _map.put(key, newValue);
    }
    return this;
  }
@Test(dataProvider = "allTypeStats", expectedExceptions = IllegalArgumentException.class)
  public void dynamicTypeCheckWhenAddInt(MyStats stat) {
    if (stat.getType() == StatMap.Type.INT) {
      throw new SkipException("Skipping INT test");
    }
    if (stat.getType() == StatMap.Type.LONG) {
      throw new SkipException("Skipping LONG test");
    }
    StatMap<MyStats> statMap = new StatMap<>(MyStats.class);
    statMap.merge(stat, 1);
  }