@Test public void getUndefinedFunctions() throws Exception { String expression = "1 + myFunc(1)"; ExpressionSolver target = new ExpressionSolver(expression); Set<FunctionInfo> actual = target.getUndefinedFunctions(); Set<FunctionInfo> expected = new HashSet<>(Arrays.asList(new FunctionInfo("myFunc", 1))); assertThat(actual, is(equalTo(expected))); }