BAEL-5461 code for the Unit Test Private Methods in Java article (#12240)
Co-authored-by: thibault.faure <thibault.faure@mimacom.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package com.baeldung.reflection.privatemethods;
|
||||
|
||||
public class Utils {
|
||||
|
||||
public static Integer validateAndDouble(Integer input) {
|
||||
if (input == null) {
|
||||
throw new IllegalArgumentException("input should not be null");
|
||||
}
|
||||
return doubleInteger(input);
|
||||
}
|
||||
|
||||
private static Integer doubleInteger(Integer input) {
|
||||
if (input == null) {
|
||||
return null;
|
||||
}
|
||||
return 2 * input;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user