@Test public void should_answer_name() { assertEquals(server.answer("what is your name"), "spark team"); }
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 { 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 { 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); }
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); }
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);  }