code to demonstrate various GOF Patterns in JAVA