Widely used design patterns in Java with unit tests