During the course of the recent English season Cook faced calls to be replaced as both Test and one-day captain after the opener struggled for runs in both formats against 50-over world champions India.
However, he remained Test skipper and last week Cook was also confirmed as captain for the 2015 World Cup in Australia and New Zealand, with England's tour programme starting with the upcoming one-day series in Sri Lanka.
"For us it was never a question really, it was all speculation with the captaincy," Anderson, speaking at the Professional Cricketers' Association awards ceremony in London, said.
"For him I think he's had more low points than most this summer, the amount of chat that was going on about his captaincy in the Test matches then the one-dayers.
Also Read
"So to show the character he has to come through those, it speaks a lot about the guy.
"It was a huge test of character: it's a credit to himself the way he's handled it all.
"I'm sure he had a lot of doubts in his mind of whether he should have captained the Test team or the one day team.
England lost both Test and one-day series with Sri Lanka on home soil before recovering from 1-0 down to beat India 3-1 in a five-match Test series, only to lose the one-day international campaign by the same margin.