### Question:
StringCalculator { public int add(String input) { if (input.isEmpty()) return 0; String delimiter = getDelimiter(input); String numbers = getNumbers(input); return calculateSum(numbers.split(delimiter)); }  int add(String input);  }### Answer:
@Test public void emptyStringReturnsZero() { assertEquals(0, this.stringCalculator.add("")); }
@Test public void numberStringReturnsNumber() { assertEquals(1, this.stringCalculator.add("1")); }
@Test public void stringNumbersCommaDelimitedReturnsSum() { assertEquals(3, this.stringCalculator.add("1,2")); }
@Test public void multipleStringNumbersCommaDelimitedReturnsSum() { assertEquals(6, this.stringCalculator.add("1,2,3")); }
@Test public void multipleStringNumbersCommaOrReturnLineDelimitedReturnsSum() { assertEquals(6, this.stringCalculator.add("1\n2,3")); assertEquals(6, this.stringCalculator.add("1,2\n3")); }
@Test public void multipleStringNumbersCustomDelimitedReturnsSum() { assertEquals("Should return 3", 3, this.stringCalculator.add(" }