Complete the code to stub the method call using Mockito.
when(mockedList.[1]()).thenReturn("hello");
The get(0) method is stubbed to return "hello" when called on the mocked list.
Complete the code to stub the size() method to return 5.
when(mockedList.[1]()).thenReturn(5);
The size() method is stubbed correctly with parentheses to return 5.
Fix the error in the stubbing code below.
when(mockedList.get([1])).thenReturn("world");
The index argument must be an integer, so 0 is correct. Using a string or null causes errors.
Fill both blanks to stub mockedMap.get() to return 10 when key "score" is used.
when(mockedMap.[1]([2])).thenReturn(10);
put or remove which are void or different methods.The get method is stubbed with the key "score" to return 10.
Fill all three blanks to stub mockedService.calculate() to return 42 when called with 5.
when(mockedService.[1]([2])).thenReturn([3]);
compute.The calculate method is stubbed with argument 5 to return 42.
