Recall that immutability offers several benefits such as thread-safety, prevention against inadvertent modification of fields and malicious tampering. Class invariants and state are always consistent with the requirements and no defensive copying is necessary. Sometimes however, it is not possible to make sensitive classes immutable. There Fortunately, there is a mechanism that allows code to expose these mutable classes to untrusted code by granting read-only access. This is largely achieved through unmodifiable wrappers. One example is of the Collection
classes wherein a set of wrappers allow clients to observe an unmodifiable view of the particular Collection
object.
...