On running -
new IPAddressString("235.234.5.6/4").getAddress().toPrefixBlock().toIPv4().upperLongValue()
The output is - 3774873599
Whereas, the expected output was - 4026531839
On using the toUpper() I am getting the expected output - 239.255.255.255.
On converting this to toUpper().longValue(), I am getting the expected output - 4026531839