When Gary Williams retired and new Maryland coach Mark Turgeon decided not to retain assistant coach Rob Ehsan, Montrose Christian forward Justin Anderson decided not to follow through on his verbal commitment to play for the Terrapins.

On Thursday, Anderson made things as official as a verbal commitment can get, saying he has accepted a scholarship offer to play for the Virginia Cavaliers.

“I went to Maryland to play for Coach Williams and Coach Ehsan, that was my main reason for going to Maryland,” Anderson said Thursday morning. “To find out both of them were not there, that was pretty tough for me in my recruiting. Nothing against Maryland or Coach Turgeon … I thought Virginia was my second school for a reason and we just decided to go with them.”

During a conference call with reporters on Tuesday, Turgeon said that his one disappointment thus far was that some of the Terrapins’ previous recruits had not given Turgeon a chance to recruit them. While New Jersey point guard Sterling Gibbs obtained a release and signed with Texas and German forward Martin Breunig is visiting other schools, it appears Anderson might have been the one Turgeon was talking about.

“He called me about two or three days after he was hired and we just talked about keeping me a Terp and hopefully he could coach me,” Anderson said.

Anderson apparently kept his options open while Turgeon finalized his coaching staff. When Turgeon opted not to retain Ehsan, who had developed a relationship with Anderson, Anderson decided to move on.

“I thought he would be able to stay and we didn’t get that opportunity, so we had to move on,” Anderson said. Going to Maryland “would have been a better option [if Ehsan had remained on staff] but it didn’t happen. I can’t say what we would have done now, because it’s over with. All we can do now is move on.”

“Justin decided to revisit his options after Gary [Williams] retired,” Montrose Christian Coach Stu Vetter said in a statement. “He has been heavily recruited since the eighth grade and it has been an exhausting and distracting process for a teenager. Although Mark Turgeon wanted to begin recruiting him, Justin and his family decided to conclude the process.”

A 6-foot-7 junior, Anderson averaged 14 points, 7.2 rebounds, 3.4 assists, 2.1 blocks and two steals this past season as Montrose Christian finished No. 1 in The Post’s rankings and won the National High School Invitational. He is considered a phenomenal athlete with a strong work ethic and has made significant strides trying to improve his shooting range.

Anderson visited Charlottesville last week and there was some thought he would also consider Virginia Tech, which this week announced the hiring of Ehsan as an assistant to Seth Greenberg.

“We thought about it,” Anderson said. “We ended up not doing it for our own personal issues.”