@Theory
  public void testNumbersToDouble() throws Exception {
    assertThat(JsonParser.parse("60911552482230981.0").getAsDouble())
        .isEqualTo(6.0911552482230984e16);
    assertThat(JsonParser.parse("4e+42").getAsDouble()).isEqualTo(4e42);
    assertThat(JsonParser.parse("4e42").getAsDouble()).isEqualTo(4e42);
    assertThat(JsonParser.parse("4E42").getAsDouble()).isEqualTo(4e42);
    assertThat(JsonParser.parse("-4e-42").getAsDouble()).isEqualTo(-4e-42);
    assertThat(
            JsonParser.parse(
                    "9999999999999999999999999999999999999999999999999999999999999999999999999999"
                        + "99999999999")
                .getAsDouble())
        .isEqualTo(1.0e87);
    assertThat(
            JsonParser.parse(
                    "-999999999999999999999999999999999999999999999999999999999999999999999999999"
                        + "999999999999")
                .getAsDouble())
        .isEqualTo(-1.0e87);
    assertThat(
            JsonParser.parse("99999999999999999999999999.99e+99999999999999999999999999")
                .getAsDouble())
        .isPositiveInfinity();
    assertThat(
            JsonParser.parse("-99999999999999999999999999.99e+99999999999999999999999999")
                .getAsDouble())
        .isNegativeInfinity();
    assertThat(
            JsonParser.parse("99999999999999999999999999.99e-99999999999999999999999999")
                .getAsDouble())
        .isEqualTo(0.0);
    assertThat(JsonParser.parse("0.000000000000000000000000000000001").getAsDouble())
        .isEqualTo(0.000000000000000000000000000000001);
    assertThat(JsonParser.parse("-0.000000000000000000000000000000001").getAsDouble())
        .isEqualTo(-0.000000000000000000000000000000001);
    assertThat(JsonParser.parse("42").getAsInt()).isEqualTo(42);
    assertThat(JsonParser.parse("42\n").getAsInt()).isEqualTo(42);
    assertThat(JsonParser.parse("42\f").getAsInt()).isEqualTo(42);
  }
Tests for Tink's internal {@link JsonParser}.
java_src/src/test/java/com/google/crypto/tink/internal/JsonParserTest.java