Mockito: Mock class<T> object
问题 Apologies if it's already been discussed but I didn't find any solutions. Problem - Trying to mock an object of my Class of some type (e.g. class) Writing test case of method xyz() where i need to mock SomeClass.class as mentioned in below code snippets void xyz() { .. MyOtherClass.staticMethod(SomeClass.class); .. } MyOtherClass { .. <T> T staticMethod(Class<T> clazz) { } ... } Using power mockito Tried (Class) Mockito.mock(Class.class), which is not working. I hope above code clears the