public static long addCap(long a, long b) {
        long u = a + b;
        if (u < 0L) {
            return Long.MAX_VALUE;
        }
        return u;
    }
public static long addCap(long a, long b) {
        long u = a + b;
        if (u < 0L) {
            return Long.MAX_VALUE;
        }
        return u;
    }
public static long addCap ( long a , long b ) { long u = a + b ; if ( u < 0L ) { return Long . MAX_VALUE ; } return u ; }
Adds two long values and caps the sum at Long.MAX_VALUE.
@param a the first value
@param b the second value
@return the sum capped at Long.MAX_VALUE
Adds two long values and caps the sum at Long . MAX_VALUE .