-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlgorithm.java
More file actions
27 lines (22 loc) · 668 Bytes
/
Copy pathAlgorithm.java
File metadata and controls
27 lines (22 loc) · 668 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package algorithm;
import algorithm.euler.Problem002;
import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
import java.text.ParseException;
@Slf4j
public class Algorithm {
public static void main(String[] args) {
Object testCase = new Problem002();
doTest(testCase);
}
public static void doTest(Object param) {
if (!(param instanceof TestCase testCase)) {
throw new ShCodingTestException("Test case must implement TestCase interface");
}
try {
testCase.test();
} catch (ParseException | IOException e) {
throw new ShCodingTestException(e);
}
}
}