How does Java handle integer underflows and overflows?
Leading on from that, how would you check/test that this is occurring?
I think this should be fine.
static boolean addWillOverFlow(int a, int b) { return (Integer.signum(a) == Integer.signum(b)) && (Integer.signum(a) != Integer.signum(a+b)); }