@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); }
public T execute(Object input) { inputHolder.set(input); try { return executor.execute(); } finally { inputHolder.clean(); } }
FunkyFunctionWithInput implements ClassFunctionWithInput<T> { public T execute(Object input) { inputHolder.set(input); try { return executor.execute(); } finally { inputHolder.clean(); } } }
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); }
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(); }
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();  }