Complete the code to create an argument captor for a String argument.
ArgumentCaptor<String> captor = ArgumentCaptor.[1];The method forClass(String.class) creates an ArgumentCaptor for the String class.
Complete the code to verify a method call and capture its argument.
verify(mockObject).someMethod([1]);Using captor.capture() tells Mockito to capture the argument passed to someMethod.
Fix the error in retrieving the captured value from the captor.
String capturedValue = captor.[1]();The method getValue() returns the single captured argument.
Fill both blanks to capture an argument and assert its value.
verify(mock).process([1]); assertEquals("expected", captor.[2]());
Use capture() to capture the argument during verification and getValue() to retrieve it for assertion.
Fill all three blanks to capture multiple arguments and assert their values.
verify(mock, times(2)).update([1]); List<String> values = captor.[2](); assertEquals("first", values.get([3]));
Use capture() to capture each argument, getAllValues() to get the list of captured arguments, and index 0 to check the first captured value.