NASHVILLE, Tenn. — If you measure an elite big league player by how he bounces back from being dropped from the lineup due to an elongated slump, Starlin Castro passes the test.

When the Yankees’ new second baseman went into a 20-for-117 (.171) slide that started in early July and stretched into the middle of August last season, Cubs manager Joe Maddon removed the 25-year-old three-time NL All-Star from the lineup.

“It was a really tough moment for me especially because I played 150 games every year,’’ Castro, who was acquired Tuesday night for Adam Warren, said Wednesday on a conference call. “It took like a week and I thought about it every day, but I didn’t want to be a bad teammate. I wanted to keep my head up and do what I always do.’’

Eight days after being switched to second base, Castro returned to the lineup and took off at the plate beginning Aug. 19. Until the end of the regular season, he batted .342 (41-for-120) and hiked his batting average from .239 to .265. Considering he is a .281 career hitter, batted .292 and was an All-Star in 2014, it signaled a decline but showed Castro had the mental toughness to fight through a horrific slump and benching.

“I love Starlin Castro. I think he is going to be a very productive player in the American League with the Yankees,’’ Maddon said Wednesday at the Winter Meetings.

An All-Star shortstop in 2011, 2012 and 2014, Castro didn’t immediately feel comfortable moving to the right side of the infield.

“The first two games I played there I felt a little bit weird,’’ said Castro, who is being viewed as a major upgrade over Dustin Ackley and Rob Refsnyder at the plate and in the field. “But after playing three or four games there, I felt pretty good.’’

According to general manager Brian Cashman, the Yankees are confident Castro twice being present when guns (not his) were fired in the Dominican Republic and him being accused of sexual assault, for which he wasn’t charged, aren’t behavioral problems.

“We know who we are acquiring and went through everything and it’s all good,’’ Cashman said Wednesday.

Asked what “everything’’ meant, Cashman answered, “I don’t need to spend more time on it.’’

At times, Castro’s energy level has been questioned, but Cashman doesn’t foresee a problem with that.

“They said the same about [Robinson] Cano,’’ Cashman said of the former Yankees second baseman who was lambasted for not running hard to first base and criticized for not playing the field with more energy.

After hitting .300 and .307 in his first two seasons, Castro dipped to .283 in 2012 when he was an All-Star for the second consecutive year. Some pointed to the pressure of hitting third as the reason. Castro said the overall state of the Cubs’ lineup had more to do with it.

“The team we had two, three years ago, we didn’t have a really good team,’’ Castro said. “The pressure was on me and [Anthony] Rizzo because we were the only two guys in the middle of the lineup. Sometimes we had pressure.’’

If Castro has questions about entering the Yankees’ universe, he won’t have to look far to find his one-time mentor Alfonso Soriano. Castro, whom Soriano guided during his rookie year, recently moved to Tampa where Soriano has a home.

“I learned a lot. When I first got called up he took me to his house and I appreciated that,’’ Castro said.