Design pattern samples implemented in Java