class MathHelper {

    public static int add(int a, int b) throws ArithmeticException {
        int sum = a + b;
        if ((a & b & ~sum | ~a & ~b & sum) < 0) {
            throw new ArithmeticException("Overflow for " + a + "+" + b);
        }
        return sum;
    }

    private  MathHelper();

}