Do you want to practice refactoring? This is a good exercise to do so.
Refactor this code, take small steps, run the tests often.
⚒️ Refactoring Techniques you can use
- Replace Constructor with Factory Method
- Replace Conditional with Polymorphism
- Push Down Field and Method
This code is heavily inspired from https://github.com/emilybache/Parrot-Refactoring-Kata and adapted to run with the latest versions of Java and JUnit.