Replace inheritance with delegation

Last modified: 24 August 2023

The Replace Inheritance With Delegation refactoring lets you remove a class from inheritance hierarchy, while preserving the functionality of the parent. IntelliJ IDEA creates a private inner class that inherits the former superclass or interface. Selected methods of the parent are invoked via the new inner class.