Usage examples: The Decorator is pretty standard in Java code, especially in code related to streams.
All subclasses of java.io.InputStream, OutputStream, Reader and Writer have constructors that accept objects of their own type.
java.util.Collections, methods checkedXXX(), synchronizedXXX() and unmodifiableXXX().
This example shows how you can adjust the behavior of an object without changing its code.
Initially, the business logic class could only read and write data in plain text. Then we created several small wrapper classes that add new behavior after executing standard operations in a wrapped object.
The first wrapper encrypts and decrypts data, and the second one compresses and extracts data.
You can even combine these wrappers by wrapping one decorator with another.