### Question:
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);  }### Answer:
@Test(expected = RuntimeException.class) public void testCallingFunctionWithMoreThanOneArgThrowsException() throws Exception { final ToStringFunction f = new ToStringFunction(); f.call(new Object(), new Object()); }
@Test public void testCallingFunctionWithOneArgResultsInToStringOfThatArg() { final ToStringFunction f = new ToStringFunction(); final Integer input = TestHelpers.randomIntBetween(50, 100000); final Object output = f.call(input); assertThat(output).isInstanceOf(String.class); assertThat(output).isEqualTo(input.toString()); }