Commit 06db4bbb authored by Colin DAMON's avatar Colin DAMON
Browse files

Declare Calculator as a static class

parent f3728963
......@@ -3,7 +3,10 @@ package fr.ippon.stringcalculator;
import java.math.BigDecimal;
import java.util.function.BinaryOperator;
public class Calculator {
public final class Calculator {
private Calculator() {
}
public static String sum(String first, String second) {
return operate(first, second, BigDecimal::add);
......@@ -14,8 +17,8 @@ public class Calculator {
return operate(first, second, BigDecimal::subtract);
}
private static String operate(String first,
String second, BinaryOperator<BigDecimal> operation) {
private static String operate(String first, String second,
BinaryOperator<BigDecimal> operation) {
notNull(first);
notNull(second);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment