Home » Java » Mockito – Returning the first element of a list passed into method

Mockito – Returning the first element of a list passed into method

Posted by: admin June 30, 2018 Leave a comment

Questions:

I have the following method that I’m trying to mock.

public T myFunction(List<T>);

Is it possible for Mockito to return the first element of the list?

Answers: