Added the JUnitParams intorduction classes
This commit is contained in:
amilabanuka
2017-05-26 08:39:08 +08:00
committed by pedja4
parent 772038390f
commit c9cd50d581
5 changed files with 94 additions and 0 deletions
@@ -0,0 +1,15 @@
package com.baeldung.junitparams;
public class SafeAdditionUtil {
public int safeAdd(int a, int b) {
long result = ((long) a) + b;
if (result > Integer.MAX_VALUE) {
return Integer.MAX_VALUE;
} else if (result < Integer.MIN_VALUE) {
return Integer.MIN_VALUE;
}
return (int) result;
}
}