public static int multiply(int a, int b) {
        if (a == 0 || b == 0) return 0;
        int absA = abs(a), absB = abs(b);
        if (absA < absB) return multiply(b, a);
        boolean isNegative = a > 0 != b > 0;
        int result = 0;
        for (int i = 0; i < absB; ++i) {
            result = add(result, absA);
        }
        return isNegative ? negate(result) : result;
    }