BTW, Java now has pluggable type systems. One of them[1] adds true static, compile-time checks for immutability, and allows method to specify that they only receive immutable objects.
There are many others, including tainting types, linear types, physical unit types and more.
There are many others, including tainting types, linear types, physical unit types and more.
[1]: http://types.cs.washington.edu/checker-framework/current/che...