### Question:
FunkyFunctionWithInput implements ClassFunctionWithInput<T> { public T execute(Object input) { inputHolder.set(input); try { return executor.execute(); } finally { inputHolder.clean(); } } FunkyFunctionWithInput(ClassFunction<T> executor, InputHolder inputHolder); T execute(Object input); @Override String getClassSimpleName();  }### Answer:
@Test public void delegatesCall() { functionWithInput.execute(null); verify(function).execute(); }
@Test public void inputStoredInInputHolder() { final Object parameter = new Object(); when(function.execute()).thenAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { assertSame(parameter, inputHolder.get()); return null; } }); functionWithInput.execute(parameter); }
@Test public void inputHolderCleaned() { assertNull(inputHolder.get()); when(function.execute()).thenAnswer(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { assertNotNull(inputHolder.get()); return null; } }); functionWithInput.execute(new Object()); assertNull(inputHolder.get()); }