Generic interface to be used for configuring mock's answer for a single argument invocation.
Answer specifies an action that is executed and a return value that is returned when you interact with the mock.
Example of stubbing a mock with this custom answer:
import static org.mockito.AdditionalAnswers.answer;
when(mock.someMethod(anyString())).then(answer(
new Answer1<Integer, String>() {
public Integer answer(String arg) {
return arg.length();
}
}));
//Following will print "3"
System.out.println(mock.someMethod("foo"));