ExtremeStartup { public String answer(String question) { if (question == null) return teamName; Matcher sumMatcher = Pattern.compile(".*what is the sum of (\\d+) and (\\d+)").matcher(question); if (sumMatcher.matches()) { return String.valueOf(Integer.parseInt(sumMatcher.group(1)) + Integer.parseInt(sumMatcher.group(2))); } return teamName; } ExtremeStartup(String teamName); String answer(String question); static void main(String[] args);  }
@Test public void should_accept_missing_input() { assertEquals(server.answer(null), "spark team"); }
@Test public void should_answer_name() { assertEquals(server.answer("what is your name"), "spark team"); }
@Test public void should_add_numbers() { assertEquals(server.answer("what is the sum of 4 and 12"), "16"); }