According to the documentation , the implicit mockito behavior for the layout should return the default values .
By default, for all methods that return a value, the layout will return either a null value, or a primitive / primitive wrapper value, or an empty collection, if necessary. For example, 0 for int / Integer and false for boolean / Boolean.
As a result, your mockMap.keySet() will return an empty hash set, which then converts to an empty array and tries to extract the (non-existent) first element, therefore, IOOBE.

In conclusion, mockito does not use the actual implementation, but behaves normally as intended.
You did not publish the entire SuperClass constructor, but probably after you create the map, you will also fill it with values. If this is true, then it can be argued that the exception is actually proof that mockito is not using a real implementation, because you really get the first element.
As for solutions, it has already been proposed to return your own hash set with any data that you need (loans go to Abubakkar):
when(mockMap.keySet()).thenReturn(new HashSet(Arrays.asList("your day string")));
source share