Design patterns practice using Java