It was a simple twist of fate. Had it not been for Dwyane Wade’s third significant hamstring injury thus far this season, he might not even be here at all. And yet, it now appears that shooting guard Tyler Johnson could be here for years to come, as the Miami Heat development machine has churned out another supremely talented youngster.

First, it was Hassan Whiteside. Whiteside has been rampaging through the NBA with reckless abandon, utilizing his massive 7-foot-7-inch wingspan to throw down monstrous alley-oop dunks, snatch rebounds out of the sky from high above the rim, swat basketballs as Godzilla would planes, and generally wreak havoc on both ends of the floor.

Now, it is Johnson, whose exploits have provided a great deal of promise for the future! Johnson is short (6-foot-3) and slight (190 pounds), and at times miscast by the Heat as a point guard, but he makes up for it with serious hops and sweet shooting. He’ll throw down a highlight-reel dunk just as easily as he’ll swish a three-pointer when his feet are set. But he’ll also do the little things you may not notice — like play the game with a tremendous energy, or grab a rebound typically reserved for a player twice his size.

For president Pat Riley and the Heat front office, Johnson, who went undrafted in June out of Fresno State, has become a scouted, developed talent.

He impressed enough during his four years in college – including a senior season during which he averaged 15.3 points, on 47.7 percent shooting from the floor and 43.2 percent from three-point range, and 7.3 rebounds in his 35 games — for the Heat to invite him to participate in Summer League.

He played well for the Heat’s Summer League squads in the Orlando and Las Vegas tournaments in July, averaging 12.5 points, 3.0 rebounds, 1.5 assists and 22.8 minutes while shooting 55.1 percent from the field in 10 games.

He played well enough, in fact, to earn a training camp invitation. He made just one preseason appearance, but he made it count. In the Heat’s overtime win against the San Antonio Spurs, he finished with 17 points (on 6-13 shooting, including 1-2 from 3-point range), four steals, four rebounds and two assists in 36 minutes. He was never going to make the regular season roster, but the Heat gave him a $75,000 partial guarantee so that it could re-direct him to its D-League affiliate, the Sioux Falls Skyforce, after being waived.

In 13 games for the Skyforce — all starts — he averaged 18.5 points on 47.7 percent shooting, including 46.3 percent 3-point shooting, in addition to 4.4 rebounds and 3.8 assists in 33.9 minutes per game.

The Heat took notice of his stellar play, and rewarded him for it.

On Jan. 12, Johnson thought he had his big break when the Heat called him up on a 10-day contract. But he was wrong. Johnson was with the team for five games. He didn’t play at all in four of them. His only action was 1:44 of mop-up duty in one game, during which he scored two points on a pair of free throws, his only statistics. When it was all over, the Heat chose not to re-sign him. He went back to the Sykforce on Jan. 22 as an unrestricted free agent.

Five days later, Wade strained his right hamstring. Two days after that, Johnson was re-signed to a second 10-day contract. This time around, with the Heat lacking in depth and forced to play him, Johnson seized his chance. He had two breakout performances during his second 10-day stint – producing 13 points, nine rebounds, four assists, two steals and two blocks in a road win over the Boston Celtics on Feb. 1, followed by an 18-point effort against the Spurs on Friday.

Multiple NBA teams were circling as he again became an unrestricted free agent Sunday morning. The Heat, however, got its man. And it figures to be a long-term affair for the promising young rookie.

Johnson was signed to a two-year minimum salary contract on Sunday. It will pay out a guaranteed $199,950 for the rest of this season, bringing his total payout on the season to $334,637 excluding his D-League pay (not bad for an undrafted basketball player in his first year out of college). It also contains a non-guaranteed second season at $845,059, which will become 50 percent guaranteed on August 1 and fully so on opening night.

Johnson and Whiteside now represent a potential future of youth and athleticism at positions of critical need for the Heat, possibly for many years to come. But even though both are mid-season signees in their first years with the Heat, and even though both are now playing under two-year minimum salary contracts that expire at the same time, their free agent statuses are very different. Johnson’s future in Miami, should the Heat want it so, is far more secure.

Johnson, like Whiteside, will be a free agent in the summer of 2016, having accrued two years of service with the Heat. However, Johnson, unlike Whiteside, has accrued just two total years of NBA service (to Whiteside’s four). As such, he will face two critical restrictions that will ensure he remains in Miami.

First, Johnson will be a restricted free agent: This will give the Heat the right to keep him by matching a contract he signs with any other team.

Restricted free agency exists only on a limited basis. It is allowed only for players coming off rookie-scale contracts, and for players who have been in the league three or fewer seasons. In order to make their free agent a restricted free agent, a team must submit a qualifying offer to the player between the day following the last game of the NBA Finals and June 30. The qualifying offer is a standing offer for a one-year guaranteed contract, which becomes a regular contact if the player decides to sign it. The amount of the qualifying offer for Johnson will be $1,180,431. If the Heat extends Johnson a qualifying offer, it will have the legal right to match any contract he signs with any other team.

Second, Johnson will be subject to the Gilbert Arenas provision: This will limit what any other team can offer him, all the way down to an amount that the Heat, by rule, will be able to match.

The Arenas provision limits teams in the salary they can offer to another team’s restricted free agent who has accrued one or two years in the league. The first-year salary in the offer sheet cannot be greater than the Non-Taxpayer Mid-Level exception, and the contract must span two to four seasons in length.

Limiting the first-year salary in this way enables the player’s original team to match the offer sheet by using its own Non-Taxpayer Mid-Level exception (provided they have access to it, which the Heat won’t) or the Early Bird exception (provided it is applicable, which for the Heat with Johnson it will be).

The Early Bird exception allows a team to exceed the cap to re-sign its own free agents, provided that the player has played with the team for all or parts of two seasons without changing teams as a free agent and finishes the second season on the team’s roster. A team may use the Early Bird exception to re-sign its own free agent for up to 175 percent of his salary in the previous season or 104.5 percent of the average salary in the previous season, whichever is greater. Early Bird contracts must be between two and four seasons in length, with raises up to 7.5 percent of the salary in the first season of the contract.

The beauty of Johnson’s contract situation, therefore, lies in the intersection of four distinct truths about the summer of 2016: (i) he will be a restricted free agent, (ii) he will be subject to the Gilbert Arenas provision, (iii) he will be an Early Bird free agent, and (iv) he will enter the summer having played at the minimum salary the season prior.

So what will happen with Tyler Johnson in the summer of 2016?

Because he will be a restricted free agent, the Heat will have the right to match any contract he signs with another team.

Because of the restrictions of the Gilbert Arenas provision, the largest starting salary any outside team will be able to offer is $5.6 million (the value of the Non-Taxpayer Mid-Level exception), in a contract that spans between two and four years in length(1). The second-year salary in such a contract can be for up to $5.9 million, while the third and fourth seasons can jump considerably, to $22.7 million (approximate) and $23.7 million (approximate), respectively, for a total of up to $57.9 million (approximate).

Because the Heat will have accrued his Early Bird rights, the Heat will have the means to match any contract he signs with another team (even up to the four-year, $57.9 million maximum). If he were to instead sign directly with Miami, the Heat would be able to leverage his Early Bird rights to offer him a contract with a starting salary equal to 104.5 percent of the NBA’s average salary in the prior season (2015-16), which figures to be roughly $6.2 million. The second, third and fourth year salaries would include standard raises to $6.7 million (approximate), $7.1 million (approximate) and $7.6 million (approximate), respectively, for a total of $27.6 million (approximate) over four years.

Because he will enter the summer of 2016 having played at the minimum salary in the prior season (2015-16), his cap hold(2) will be equal to $980,431, the minimum salary for a two-year veteran for the 2016-17 season. If the Heat extends Johnson a qualifying offer, and it will, his cap hold would increase slightly, to $1,180,431.

These four truths, taken together, produce one powerful result: Whatever the Heat has planned for the summer of 2016, at a cost of no more than $1.2 million, it can use up all of its cap space to do it. Then, after all of its cap space is used up, the Heat can circle back to Johnson, utilizing his Early Bird rights to give him a contract that exceeds the salary cap.

Unlike with Whiteside, there is no catch: While the Heat can only utilize this strategy to give Johnson a starting salary of up to a projected $6.2 million (i.e., whatever 104.5 percent of the NBA’s average salary for 2015-16 comes to), unlike with Whiteside, it will have little reason to give him more than that. Since Johnson will not be eligible for a starting salary of more than $5.6 million anywhere else, offering more than $6.2 million would be rather unnecessary(4).

The Heat can give Johnson more than $6.2 million — in fact, it can give him up to his $20.9 million projected maximum salary – but, to do so, the Heat would need to fit his entire starting salary within the team’s cap space (as opposed to just his cap hold). Given its need to preserve cap space for Wade, Whiteside and others, the Heat won’t do that. Which means the largest contract he can hope to get next summer is four years and $57.9 million from another team (which the Heat could match) or four years and $27.6 million directly from the Heat.

In the event Johnson were to feel he is worth more than what any team is offering, he could choose to accept the Heat’s $1.2 million qualifying offer, play under its terms for the 2016-17 season, and then re-enter free agency the following summer. At that point, he’d still be a restricted free agent, but would no longer be subject to the Gilbert Arenas provision (which would entitle him to shoot for as much as a full maximum contract).

Of course, unlike with Whiteside, who has largely already done so, Johnson needs to first prove he is worthy of a significant contract. These rules give the Heat the right to retain Johnson next summer, but certainly not an obligation to do so.

So where does the Heat stand for the summer of 2016?

The salary cap is expected to rise from a projected $67.8 million next season to anywhere from $87 million to $90 million the following year (unless a salary cap smoothing mechanism is implemented), as the league’s massive new $24 billion TV rights takes effect.

The Heat, which currently only has Chris Bosh and Josh McRoberts under guaranteed contracts that extend that far out, therefore figures to have anywhere from $57 million to $60 million of summer of 2016 cap space with which to work.

Re-signing Whiteside to a starting salary of greater than $6.2 million would eat into that cap space, up to however much of the projected $21 million maximum salary he demands. Johnson, however, will only cost up to $1.2 million against the cap, even if he ultimately signs a contract with a starting salary as high as $6.2 million.

The Heat has therefore just signed Johnson to the most summer-of-2016 cap-friendly contract possible.

Better still: Johnson will be under Heat control for at least four years, and probably several more. He is already under contract for this year and next. He will be a restricted free agent in the summer of 2016, and the Heat will have the means to match any contract he signs (including the one-year qualifying offer). Even if he is to sign just a one year deal (which, by rule, he could only do with the Heat) in order to become free agent in the summer of 2017, Johnson, as a then-three-year NBA veteran, could again be made a restricted free agent if the Heat were to extend a second qualifying offer, at which point the Heat will have accrued his full Bird rights and be able able to match any offers he receives on the open market (all the way up to a maximum contract). Therefore, the earliest Johnson would be eligible to shake free from the Heat, should he choose to do so, would be the summer of 2018. But it is far more likely that, if he performs, Johnson will re-sign with the Heat to a long-term contract in the summer of 2016, ensuring he will be with the Heat for longer even than that.

Tyler Johnson, therefore, is very much a part of the Miami Heat future.

Notes:

(1) The second-year salary in such an offer sheet is limited to the standard 4.5 percent raise. The third-year salary can jump considerably – it is allowed to be as high as it would have been had the first-year salary not been limited by this rule to the Non-Taxpayer Mid-Level exception. The salary in the fourth season may increase (or decrease) by up to 4.1 percent of the salary in the third season. The offer sheet can only contain the large jump in the third season if it provides the highest salary allowed in the first two seasons, it is fully guaranteed, and it contains no bonuses of any kind.

If the raise in the third season exceeds the standard raise (4.5 percent of the salary in the first season of the contract), then an additional restriction exists. In order to determine how large the offer can be, the team doesn’t just have to fit the first-year salary under the cap. Instead, they must fit the average salary in the entire contract under the cap. Rather than his actual salary, the player’s average salary counts as team salary over the life of his contract.

If the player’s prior team matches the offer and keeps the player, then the actual salary in each season counts as team salary.

Therefore, the most any other team can offer Johnson is a four-year contract paying out roughly $57.9 million, which counts $14.5 million against the salary cap in each year. If the Heat matches, the cap hits would be $5.6 million for 2016-17, $5.9 million in 2017-18, $22.7 million (approximate) in 2018-19 and $23.7 million (approximate) in 2019-20.

(2) Cap holds are placeholder charges against team salary for a team’s own free agents. They are designed to protect against a team using all of its cap space to sign outside free agents and then circling back to its own free agents utilizing their Bird rights, which allow teams to exceed the cap to re-sign their own players.

Cap holds can be released in order to free up the cap space, but it comes at a cost. To release such cap holds, a team can either re-sign the free agent, at which point his cap hold is replaced with his new salary, or renounce him, at which point his team forfeits his Bird rights.

The amount of the cap hold depends upon several factors, including the player’s previous salary and what kind of free agent he is. Cap holds for most players are between 120 percent and 250 percent of their previous salary, but for players on minimum salary contracts are equal to the portion of the minimum salary not reimbursed by the league.