Description of the problem / feature request:
UnusedVariable triggers for a method like this:
private static boolean compare(int left, int right)
{
throw new AssertionError("this method should not be called");
}
We can rename the parameters to unusedLeft and unusedRight, which is often a good way to signal intent to readers of the code, but that is redundant in this case, since it's immediately obvious that this method will not use the parameters.
What version of Error Prone are you using?
2.4.0