code: public static synchronized <T> void spy(Class<T> type) {
          MockSettings mockSettings = Mockito.withSettings().defaultAnswer(Mockito.CALLS_REAL_METHODS);
          DefaultMockCreator.mock(type, true, true, type, mockSettings, (Method[]) null);
      }
docs: Spy on classes (not &quot;spyable&quot; from normal Mockito).
  
  @param <T>  the type of the class mock
  @param type the type of the class mock
  @see PowerMockito#spy(Object)