Function lengthFunction = new Function() { public Integer apply(String string) { return string.length(); } };