When the weight is set to zero (which is possible with a custom weight adjuster) we can get failures in comparing schedulables.
This is because when calculating running tasks to weight ratio could result in a 0.0/0.0 which ends up as NaN. Comparisons with NaN are undefined such that (int)Math.signum(NaN - anyNumber) will be 0 causing different criteria to be used in comparison which may not be consistent. This will result in
IllegalArgumentException: Comparison method violates its general contract!