@Test
  public void parsedNumberGetValue() throws Exception {
    JsonElement numElement = JsonParser.parse("42.42");
    assertThat(numElement.getAsInt()).isEqualTo(42);
    assertThat(numElement.getAsLong()).isEqualTo(42);
    assertThat(numElement.getAsFloat()).isEqualTo(42.42f);
    assertThat(numElement.getAsDouble()).isEqualTo(42.42);
    Number number = numElement.getAsNumber();
    assertThat(number.intValue()).isEqualTo(42);
    assertThat(number.longValue()).isEqualTo(42);
    assertThat(number.floatValue()).isEqualTo(42.42f);
    assertThat(number.doubleValue()).isEqualTo(42.42);
  }
Tests for Tink's internal {@link JsonParser}.
java_src/src/test/java/com/google/crypto/tink/internal/JsonParserTest.java