class WeightClassificationUtils {

    public static WeightClass eqResponseToWeightClass(EqWeightResponse eqWeightResponse) {

        int badCount = 0;
        int okCount = 0;
        int goodCount = 0;

        WeightClass hiClass = weightHiEqRegister(eqWeightResponse);
        WeightClass midClass = weightMidEqRegister(eqWeightResponse);
        WeightClass lowClass = weightLowEqRegister(eqWeightResponse);

        if (hiClass.equals(WeightClass.BAD)) {
            badCount++;
        }

        if (midClass.equals(WeightClass.BAD)) {
            badCount++;
        }

        if (lowClass.equals(WeightClass.BAD)) {
            badCount++;
        }

        // /////////////////

        if (hiClass.equals(WeightClass.OK)) {
            okCount++;
        }

        if (midClass.equals(WeightClass.OK)) {
            okCount++;
        }

        if (lowClass.equals(WeightClass.OK)) {
            okCount++;
        }

        // /////////////////

        if (hiClass.equals(WeightClass.GOOD)) {
            goodCount++;
        }

        if (midClass.equals(WeightClass.GOOD)) {
            goodCount++;
        }

        if (lowClass.equals(WeightClass.GOOD)) {
            goodCount++;
        }

        if (okCount >= goodCount && okCount >= badCount) {
            return WeightClass.OK;
        }

        if (badCount >= goodCount && badCount >= okCount) {
            return WeightClass.BAD;
        }

        return WeightClass.GOOD;
    }

}