I'm testing my code with Mockito and I have used:

```
RequestWrapper requestWrapper = mock(RequestWrapper.class);

```

I thought it mocks the **requestWrapper instance** of RequestWrapper.class.

Instead, when in the code of the ***system under test*** I debug this:

```
RequestWrapper a = new RequestWrapper(request);
RequestWrapper b = new RequestWrapper(request);
RequestWrapper c = new RequestWrapper(request);

```

I figure out that **a, b, c** instances of RequestWrapper are all mocked.
So it seems that the instance name of the Mocked class (not mocked Object then as I figured out!) has no importance at all.

So, my questions are:

* what sense has mocking an instance of a class (defining a specific instance name) if when you use *Mockito.mock()* you get all instances of the same class mocked equally?
* And the other one is, if I want to define different behaviours of my mocked instances, do I have to declare in the test the correct names of the instances in order to define a different behaviour with *when().then()*?

EDIT: Update
------------

Sorry I got wrong. Only the instance explicitly mocked become a mock. The others are object of the real classes. I got wrong because of all the other mocked dependencies in the real class too.

So it's not true that if I mock an instance of a class, all the other instances of that class are instantiated as mocks. They are object of the real class.

Thank you for your useful answers, I apologize for the error.