When the going gets tough, when momentum is poised to shift, when a moment needs to be seized, the Miami Heat finds a way to step up and step on the throats of its opposition.

It arrived on Sunday, early in the fourth quarter, the Raptors no longer content to play a casual game, more bent on attacking the rim, more inclined to compete and the game was tied 77-77.

The Air Canada Centre crowd, which booed Chris Bosh and cheered LeBron James and Dwyane Wade, finally became engaged, but in such environments, attention to detail becomes vital.

The Raptors couldn’t deliver, while the Heat calmly went about its business, whether it was making a stop or creating a look that led to an easy basket.

All of a sudden, Miami would go on a 12-0 run and create enough separation to run its win streak to 22, showing no signs of weakness.

The fact the Raptors lost, 108-91, shouldn’t come as a surprise to no anyone.

The surprise was the way in which Toronto played the entire first half, a period of wretched basketball where absolutely no offence was run, nothing discernible anyway, and careless turnovers were produced.

The Raps’ play did improve in the second half, but they would basically regress once the Heat picked up its game.

To any basketball purist, the first half of Sunday’s matinee was amateur hour at its finest, players smiling and running up and down the floor with absolutely no sense of urgency.

The only thing missing were uncontested dunks.

It was quite comical, but thankfully the tenor turned more serious in the second half, especially when DeMar DeRozan began to be aggressive following a brutal first-half performance.

Toronto outscored the Heat, 30-21, in the third quarter, tied the game in the fourth, but could not sustain its level of play.

“We’ve got to sustain that,’’ said head coach Dwane Casey. “We’ve got to sustain that type of performance, that type of consistency and focus at both ends of the floor.

“Against a team like that, there can’t be lapses. I thought we had lapses. I thought we played well in the second half. Once we came out swinging in the second half, I thought our guys competed.”

Whether it was too much one-on-one, too little production from the point position, too much watching and being in awe of the visiting Heat, there was so much that went wrong with the Raptors in the opening half.

For far too long a stretch, the Raptors played this kind of glorified pick-up game that plays right into Miami’s hands.

No team, let alone one such as the incomplete Raptors, can’t afford to turn the ball over.

To beat the Heat, defence must be played at a high level on every possession.

In Sunday’s first half, the Raptors allowed Miami to make 61.8% of its shots in taking a 55-43 lead.

Miami turned 11 of Toronto’s turnovers into 14 points, limited the home side to one free throw and kept the starting backcourt to the grand total of two points.

Had it not been for Amir Johnson, who yet again emerged as Toronto’s best player, the game would have been over well before the break.

With a date in Boston looming on Monday night for the Heat, no way the atmosphere in Beantown will resemble the all-star -like backdrop that turned the ACC into a playground akin to a pickup game.

The Heat should get its toughest test during this remarkable streak that has seen Miami take complete control of the East.

The Celtics aren’t going to blink at Miami, won’t acknowledge any player, not even former teammate Ray Allen, and will grind it out and try to establish a half-court slugfest.

Miami seemed to play down to its opposition in the second half on Sunday, but credit the Raptors with bringing an energy level and a commitment that went missing in the opening half.

But when push comes to shove, the Raptors are nowhere near Miami’s class and for that they are not alone.

The Celtics are a different breed, a veteran-laden team that will push back.

On Sunday, the Raptors were reduced to pushovers.

CASEY OFFERS KUDOS

On a team featuring two superstars capable of going off at any moment against any team in any environment, defence often gets overlooked.

But it’s defence that wins championships. Dwane Casey once helped Dallas to its first and only NBA title two years ago when the Mavs upset the Heat in a six-game series Miami once lead 2-1.

On Sunday afternoon at the Air Canada Centre, Casey’s Raptors came back from a double-digit deficit to tie the game 77-77 in the opening minute of the final quarter. The Heat would go on to win, 108-91.

“They are a well-oiled machine,’’ said Casey. “They are well-put-together. Offensively, they are efficient, but when they turn up the heat defensively they can make it rough on you. They do it in a classy way.”

That lethal combination of an offence featuring LeBron James and Dwyane Wade, coupled with a stifling defence, is what makes Miami the class of the NBA.

Only complacency will prevent the Heat from appearing in its third straight NBA final because no team in the East is good enough to beat it in a seven-game series.

It’s unlikely any team in the league can stop Miami, especially when the Heat picks up its defence.