@Test(expected = RuntimeException.class) public void testCallingFunctionWithMoreThanOneArgThrowsException() throws Exception { final ToStringFunction f = new ToStringFunction(); f.call(new Object(), new Object()); }
@Override public Object call(Object... args) { if (args.length != 1) { throw new RuntimeException(String.format("Incorrect number of arguments (%s), expected 1", args.length)); } else { return args[0].toString(); } }
ToStringFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 1) { throw new RuntimeException(String.format("Incorrect number of arguments (%s), expected 1", args.length)); } else { return args[0].toString(); } } }
ToStringFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 1) { throw new RuntimeException(String.format("Incorrect number of arguments (%s), expected 1", args.length)); } else { return args[0].toString(); } }  }
ToStringFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 1) { throw new RuntimeException(String.format("Incorrect number of arguments (%s), expected 1", args.length)); } else { return args[0].toString(); } }  @Override Object call(Object... args); }
ToStringFunction implements FreeFunction { @Override public Object call(Object... args) { if (args.length != 1) { throw new RuntimeException(String.format("Incorrect number of arguments (%s), expected 1", args.length)); } else { return args[0].toString(); } }  @Override Object call(Object... args);  }