Mockito and Mockito.any (Map.class) - Stack Overflow
stackoverflow.com › questions › 35437077Feb 16, 2016 · (I'd previously put that as a "dummy value" to return, Mockito can return an empty Map for calls to anyMap(), but can only return a null for calls to any(Map.class). If restOperationMock.exchange delegates to a real implementation during stubbing, such as if it were a spy or unmockable method (final method, method on a final class, etc), then that dummy value may be used in real code.