@Override
    public boolean equals(Object obj) {
      if (this == obj) {
        return true;
      }
      if (obj instanceof LazilyParsedNumber) {
        LazilyParsedNumber other = (LazilyParsedNumber) obj;
        return value.equals(other.value);
      }
      return false;
    }
This is a modified copy of Gson's internal LazilyParsedNumber.
java_src/src/main/java/com/google/crypto/tink/internal/JsonParser.java