static CounterResult fromJson(String json) {
    return JsonUtil.parse(json, CounterResultParser::fromJson);
  }
@Test
  public void unsupportedUnit() {
    assertThatThrownBy(() -> CounterResultParser.fromJson("{\"unit\":\"unknown\",\"value\":23}"))
        .isInstanceOf(IllegalArgumentException.class)
        .hasMessage("Invalid unit: unknown");
  }