Mocking a static method with generic parameter
问题 i am trying to mock a static method with sigature public static <T extends Object> T get( String name, Class<T> i ) { return null } and i am using PowerMockito, and below is my expected code PowerMockito.when(ClassName.class, "get", "name", Class.class).thenReturn("Hi"); but its throwing org.powermock.reflect.exceptions.MethodNotFoundException: No method found with name 'get' with parameter types: [ java.lang.String, java.lang.Class ] Can anyone plz give the clue how to mock this using