"See it's the drive that you have towards the game. It's not going to stop here. I still have a few more years."
While Mathews acknowledged that cricket had "taken a toll on my body" in recent years, he said he would work on his fitness and form.
"Age is just a number and I am still willing to give it my best in all three formats."
Anderson, who gave up the white-ball formats to concentrate on Tests, has claimed 657 wickets in 172 five-day matches since making his debut in 2003.
Mathews, a middle-order batsman and a medium-pace bowler -- although he now seldom bowls due to injuries -- has scored 6,876 runs in 99 Tests since his 2009 debut against Pakistan in Galle.
"I haven't given up bowling in T20s and ODIs. But when you play Test cricket in the subcontinent, my type of bowling will not suit the team that much," he said.
The second Pakistan Test will be Sri Lanka's last this season before the team travels to New Zealand in March next year for two five-day games.
Mathews urged Sri Lanka Cricket (SLC) to include more red-ball matches in the team's itinerary.
"I prefer Test cricket. We like if there are many more Test matches because most of the leading players want to play more Test cricket," said Mathews, who called the Test win under his captaincy at Headingley in 2014 one of his career highlights.
"But, unfortunately, I think we have about seven Test matches for next 18 months or so. We hope SLC would make arrangements to include few more Test matches."
Captain Dimuth Karunaratne, who played cricket with Mathews at the same school, said a win in Galle to level the series would be an ideal gift for the veteran.
"Like for Angelo, even for us it's a great occasion. It's not an easy thing to play 100 Test matches," said Karunaratne.
"So trying to make it memorable. When we win there is lot of joy and that's what we want to do in this game."