static CounterResult fromJson(String json) {
    return JsonUtil.parse(json, CounterResultParser::fromJson);
  }
@Test
  public void invalidValue() {
    assertThatThrownBy(
            () -> CounterResultParser.fromJson("{\"unit\":\"count\",\"value\":\"illegal\"}"))
        .isInstanceOf(IllegalArgumentException.class)
        .hasMessage("Cannot parse to a long value: value: \"illegal\"");
  }