code: @Nullable
    public static Long getExactLongFromDecimalString(String decimalStr)
    {
      final Long val = GuavaUtils.tryParseLong(decimalStr);
      if (val != null) {
        return val;
      }
  
      BigDecimal convertedBD;
      try {
        convertedBD = new BigDecimal(decimalStr);
      }
      catch (NumberFormatException nfe) {
        return null;
      }
  
      try {
        return convertedBD.longValueExact();
      }
      catch (ArithmeticException ae) {
        // indicates there was a non-integral part, or the BigDecimal was too big for a long
        return null;
      }
    }
docs: Convert a string representing a decimal value to a long.
  
  If the decimal value is not an exact integral value (e.g. 42.0), or if the decimal value
  is too large to be contained within a long, this function returns null.
  
  @param decimalStr string representing a decimal value
  
  @return long equivalent of decimalStr, returns null for non-integral decimals and integral decimal values outside
  of the values representable by longs