Implementation of some design patterns in Java to give an idea of what they look like in code