docs: <T> void mockClass(MockFeatures<T> features) {
          boolean subclassingRequired = !features.interfaces.isEmpty()
                  || Modifier.isAbstract(features.mockedType.getModifiers());
  
          if (subclassingRequired
                  && !features.mockedType.isArray()
                  && !features.mockedType.isPrimitive()
                  && Modifier.isFinal(features.mockedType.getModifiers())) {
              throw new MockitoException("Unsupported settings with this type '"
                      + features.mockedType.getName() + "'");
          }
  
          synchronized (lock) {
              Set<Class<?>> types = new HashSet<>();
              Class<?> type = features.mockedType;
  
              do {
                  boolean wasAdded = mockedTypes.add(type);
  
                  if (wasAdded) {
                      if (!EXCLUDES.contains(type)) {
                          types.add(type);
                      }
  
                      type = type.getSuperclass();
                  } else {
                      break;
                  }
              } while (type != null && !type.isInterface());
  
              if (!types.isEmpty()) {
                  try {
                      agent.requestTransformClasses(types.toArray(new Class<?>[types.size()]));
                  } catch (UnmodifiableClassException exception) {
                      for (Class<?> failed : types) {
                          mockedTypes.remove(failed);
                      }
  
                      throw new MockitoException("Could not modify all classes " + types, exception);
                  }
              }
          }
      }