SplitFunction extends BinaryFunction { public List<String> evaluate(String input, String regex){ Pattern pattern = RegExUtil.compile(regex, null); String[] values = pattern.split(input, -1); return Arrays.asList(values); } SplitFunction();  SplitFunction(String name); List<String> evaluate(String input, String regex); @Override FieldValue evaluate(FieldValue first, FieldValue second);  }
@Test public void evaluate(){ assertEquals(Arrays.asList(""), evaluate("", ";")); assertEquals(Arrays.asList("", ""), evaluate(";", ";")); assertEquals(Arrays.asList("", "", ""), evaluate(";;", ";")); assertEquals(Arrays.asList("A"), evaluate("A", ",")); assertEquals(Arrays.asList("", "A"), evaluate(",A", ",")); assertEquals(Arrays.asList("A", ""), evaluate("A,", ",")); assertEquals(Arrays.asList("", "A", ""), evaluate(",A,", ",")); }