In JDK there are many places where Decorator design pattern is
used. Some of these are as follows:
1. In java.io package many classes use Decorator pattern.
Subclasses of java.io.InputStream, OutputStream, Reader
and Writer have a constructor that can take the instance of
same type and decorate it with additional behavior.
2. In java.util.Collections, there are methods like
checkedCollection(), checkedList(), checkedMap(),
synchronizedList(), synchronizedMap(),
synchronizedSet(), unmodifiableSet(), unmodifiableMap()
and unmodifiableList() methods that can decorate an object
and return the same type.
3. In javax.servlet package, there are classes like
javax.servlet.http.HttpServletRequestWrapper and
HttpServletResponseWrapper that are based on Decorator
design pattern
https://www.digitalocean.com/community/tutorials/decorator-design-pattern-in-java-example