class BmiCalculator {

    public BmiValue calculate(float heightInMeter, float weightInKg) {
        if (heightInMeter < 0 || weightInKg < 0) {
            throw new RuntimeException("身長・体重には正の実数を指定してください");
        }
        float bmiValue = weightInKg / (heightInMeter * heightInMeter);
        return createValueObj(bmiValue);
    }

}