Normally when using mockito I will do something like
Mockito.when(myObject.myFunction(myParameter)).thenReturn(myResult);
Is it possible to do
In Java 8 it is even simpler than all of the above:
when(mockObject.myMethod(anyString())) .thenAnswer(invocation -> invocation.getArgumentAt(0, String.class));