When government leaders are sent to jail, one of two things is happening; either they are the victim of a system where the rule of law is absent, in which case the judicial process is largely irrelevant, or they are being jailed after due process because the rule of law has prevailed.

Fortunately for Hong Kong, the jailing of former chief executive Donald Tsang Yam-kuen can be seen as an indication of a doggedly maintained judicial system.

But, as recent events have shown, this cannot be taken for granted.

Rule of law can be said to prevail only when there is equal treatment for all citizens. In the Tsang case, Mr Justice Andrew Chan Hing-wai underlined this fundamental principle in refusing to grant bail because he insisted that there was no case for giving special treatment to a defendant purely on grounds that he was rich or famous.

WATCH: Former Hong Kong chief executive, Donald Tsang, sentenced to prison

If this stricture is to apply to a person who is already in the dock, the same considerations must apply to the way that the Department of Justice operates in deciding whom to prosecute.

When suspicion lingers over the integrity of the prosecutions system, the good work done in the courts can be severely undermined. This brings us to the situation of Tsang’s successor, Leung Chun-ying, whose affairs have been under investigation by the Independent Commission Against Corruption (ICAC) for a suspiciously lengthy period of two years and five months with no sign of a conclusion.

The Leung case involves a failure to disclose a payment of HK$50 million from Australian engineering firm UGL made in 2012 and 2013 while Leung was chief executive, a payment he failed to disclose to the Executive Council.

Tsang’s conviction stems from a failure to disclose ties with Bill Wong Cho-bau, a Wave Media shareholder, at a time when the allocation of digital radio licences was under discussion involving this company.

The ICAC investigation into Leung is said to revolve around whether he should have disclosed this payment in 2013 when he participated in Executive Council discussions concerning his old company DTZ Japan, which was taken over by UGL.

As information about this case remains obscure there is no way of knowing whether Leung has a case to answer, but the old legal adage of “justice delayed, is justice denied” seems relevant here.

All we know for a fact is that Rebecca Li Bo-lan, who led the investigation into the UGL case and became the acting head of the agency’s investigation unit, was effectively demoted and told to return to her previous, more junior, post. Li then resigned, followed by another senior ICAC figure.

It is hard to believe that a sensitive decision regarding this high-level post did not cross the chief executive’s desk as he has direct responsibility for the commission. However, Leung denies any role in this matter. What remains is a cloud of suspicion that can be removed only by concluding the ICAC investigation and providing some transparency over what is going on.

There has, of course, been far more transparency over the jailing of seven policemen for the assault of Ken Tsang Kin-chiu during the 2014 Occupy protests.

Defenders of the rule of law have taken it as a good sign that the impartial hand of justice can reach out as far as law enforcers because if the principle of equality before the law has any meaning it cannot exclude those on the front lines of law enforcement. But what followed has been a series of extreme verbal assaults on the judge in this case, accompanied by threats of violence against him. It might be thought in these circumstances that the secretary of justice, Rimsky Yuen Kwok-keung, would have been at the forefront of those seeking to defend the independence and integrity of the judiciary but he has only once commented on this matter and did so in general terms saying that action might be taken against personal attacks on judges. Significantly, the chief executive has remained silent.

The whole point about the administration of justice is that it is not tested by the enormity of crimes, the length of convictions or indeed the numbers involved but by what happens when justice is delivered in the most sensitive cases, where passions are running high.

Obviously the nexus of jailing policemen as a result of political protests is almost a classic example of where this test is applied.

In pictures: the rise and fall of former Hong Kong leader Donald Tsang

The reality is that Hong Kong society is divided on political lines and this fracture deepens when the law comes into play, but in challenging the rule of law and going to the extreme of threatening judges, those making that challenge threaten the underpinnings of the entire system. Either you accept the rule of law, with all its consequences, and indeed imperfections, or you don’t. And once the application of justice becomes a matter of political expedience, all bets are off.

Stephen Vines is a Hong Kong-based writer and commentator