Examples of the implementation of immutable objects in Java
/src/main/java/immutable/primitive/ImmutableUser.java
/src/main/java/immutable/collection/unmodifiable
/src/main/java/immutable/collection/copy/ImmutableUserWithCollectionCopy.java
/src/main/java/immutable/collection/unmodifiable/ImmutableUserWithCollectionUnmodifiable.java
/src/main/java/immutable/withOtherLib
/src/main/java/immutable/withOtherLib/inheritance/ImmutableUserWithAddressInheritance.java
Bad solution - works well if a third-party object contains only primitive fields. If a third-party library has objects in field roles, then it is more difficult to perform inheritance.
/src/main/java/immutable/withOtherLib/deepClone/ImmutableUserWithAddressDeepClone.java