@Override
    public int compareTo(HealthStatus o) {
        if (operational != null && o.operational != null) {
            return operational.compareTo(o.operational) * -1;
        } else if (operational != null) {
            return operational == Boolean.TRUE ? -1 : 1;
        } else if (o.operational != null) {
            return o.operational == Boolean.TRUE ? 1 : -1;
        } else {
            if (severity != null && o.severity != null) {
                return severity.compareTo(o.severity);
            } else if (severity != null) {
                return 1;
            } else if (o.severity != null) {
                return -1;
            } else {
                return 0;
            }
        }
    }
@ Override public int compareTo ( HealthStatus o ) { if ( operational != null && o . operational != null ) { return operational . compareTo ( o . operational ) * - 1 ; } else if ( operational != null ) { return operational == Boolean . TRUE ? - 1 : 1 ; } else if ( o . operational != null ) { return o . operational == Boolean . TRUE ? 1 : - 1 ; } else { if ( severity != null && o . severity != null ) { return severity . compareTo ( o . severity ) ; } else if ( severity != null ) { return 1 ; } else if ( o . severity != null ) { return - 1 ; } else { return 0 ; } } }
Sorts statuses in order of "functioning level". The most functional
will appear first and the least functional will appear last.
<p>
Operation is sorted (true, null, false). For statuses with matching
operations, severity is sorted ascending, with nulls first.

@param o The status to compare
@return -1, 1, or 0