@Theory
  public void floatNumbersGetAsInt_getsTruncated() throws Exception {
    assertThat(JsonParser.parse("42.0").getAsInt()).isEqualTo(42);
    assertThat(JsonParser.parse("2.1e1").getAsInt()).isEqualTo(21);

    assertThat(JsonParser.parse("42.1").getAsInt()).isEqualTo(42);
    assertThat(JsonParser.parse("42.9999").getAsInt()).isEqualTo(42);

    // 2^31 - 1 as float
    assertThat(JsonParser.parse("2.147483647e9").getAsInt()).isEqualTo(2147483647);

    // - 2^31 as float
    assertThat(JsonParser.parse("-2.147483648e9").getAsInt()).isEqualTo(-2147483648);
  }
Tests for Tink's internal {@link JsonParser}.
java_src/src/test/java/com/google/crypto/tink/internal/JsonParserTest.java