pattern method example