If I flip a coin 1000 times and get only one head, I may suspect that the coin is biased. One justification for this suspicion is that I am unlikely to get so few heads under the null hypothesis of the coin being fair.
However, if I flip a coin 1,000 times and get precisely 500 heads and 500 tails, I might have the opposite suspicion: some force is intervening to keep the results perfectly in line with the null hypothesis. One realistic scenario we might see this is in circumstances where people try to correct for bias, e.g. with hiring demographics.
Is there a standard way of formalizing this?
One simple thing is to just look at $1 - p$, and if $1 - p <\alpha$ we could say that $H_0$ can be "anti-rejected" at $\alpha$.
A more complicated thing would be to consider some set of alternatives $H_1,\dots, H_n$ and consider something like $\sum_i P (X\gt x | H_i) P(H_i)$. If this is below some threshold, we might consider all of the alternatives to have been rejected, and therefore we should accept $H_0$.