code: @Incubating
      @CheckReturnValue
      public static <T> T spy(Class<T> classToSpy) {
          return MOCKITO_CORE.mock(classToSpy, withSettings()
                  .useConstructor()
                  .defaultAnswer(CALLS_REAL_METHODS));
      }
docs: Please refer to the documentation of {@link #spy(Object)}.
  Overusing spies hints at code design smells.
  <p>
  This method, in contrast to the original {@link #spy(Object)}, creates a spy based on class instead of an object.
  Sometimes it is more convenient to create spy based on the class and avoid providing an instance of a spied object.
  This is particularly useful for spying on abstract classes because they cannot be instantiated.
  See also {@link MockSettings#useConstructor(Object...)}.
  <p>
  Examples:
  <pre class="code"><code class="java">
  SomeAbstract spy = spy(SomeAbstract.class);
  
  //Robust API, via settings builder:
  OtherAbstract spy = mock(OtherAbstract.class, withSettings()
  .useConstructor().defaultAnswer(CALLS_REAL_METHODS));
  
  //Mocking a non-static inner abstract class:
  InnerAbstract spy = mock(InnerAbstract.class, withSettings()
  .useConstructor().outerInstance(outerInstance).defaultAnswer(CALLS_REAL_METHODS));
  </code></pre>
  
  @param classToSpy the class to spy
  @param <T> type of the spy
  @return a spy of the provided class
  @since 1.10.12