@Test
  public void parsedNumberGetAsLong_discardsAllBut64LowestOrderBits() throws Exception {
    // It would be preferable if JsonElement.getAsLong would throw a NumberFormatException exception
    // if the number it contains does not fit into a long, similar to what Long.parseLong does.

    // Instead, the method never throws an exception, and follows the "narrowing primitive
    // conversion" of the Java Language Specification section 5.1.3, which means that all but the 32
    // lowest order bits are discarded.

    JsonElement numElement = JsonParser.parse("9223372036854775809"); // 2^63 + 1
    assertThat(numElement.getAsLong()).isEqualTo(-9223372036854775807L);
  }
Tests for Tink's internal {@link JsonParser}.
java_src/src/test/java/com/google/crypto/tink/internal/JsonParserTest.java