For certain hash functions in Java it would be nice to see the value as an unsigned integer (e.g. for comparison to other implementations) but Java supports only signed type
Just my 2 cents here, but I think it's a good practice to use:
public static long getUnsignedInt(int x) {
return x & (~0L); // ~ has precedence over & so no real need for brackets
}
instead of:
return x & 0xFFFFFFFFL;
In this situation there's not your concern how many 'F's the mask has. It shall always work!