Code sample for learning desgin pattern by using Java