Enable static mocking for all methods of a class.

@param type the class to enable static mocking
194478
public static synchronized void mockStatic(Class<?> type, Class<?>... types) {
        DefaultMockCreator.mock(type, true, false, null, null, (Method[]) null);
        if (types != null && types.length > 0) {
            for (Class<?> aClass : types) {
                DefaultMockCreator.mock(aClass, true, false, null, null, (Method[]) null);
            }
        }
    }
55856
public boolean addVarArgs(JSType type) {
    if (hasVarArgs()) {
      return false;
    }

    newParameter(type).setVarArgs(true);
    return true;
  }
222793
private void setType(Type type) {
    setSamplesPerSecond(type.getSamplesPerSecond());
    setFramesPerSecond(type.getFramesPerSecond());
    setUseSamples(type.usesSamples());
  }
1288634
static <T extends Annotation> List<List<T>> getParameterAnnotations(Method method, Class<T> type) {
		List<List<T>> annotations = new ArrayList<>();
		for (List<Annotation> paramAnnotations : getParameterAnnotations(method)) {
			annotations.add(filterAnnotations(paramAnnotations, type));
		}
		return annotations;
	}
599871
private static boolean isAccessible(final Class<?> type) {
        Class<?> cls = type;
        while (cls != null) {
            if (!Modifier.isPublic(cls.getModifiers())) {
                return false;
            }
            cls = cls.getEnclosingClass();
        }
        return true;
    }
916502
<T> void mockStatic(StaticMocking<T> mocking) {
        if (ExtendedMockito.staticMockMarker(mocking.clazz) != null) {
            throw new IllegalArgumentException(mocking.clazz + " is already mocked");
        }

        mockingInProgressClass.set(mocking.clazz);
        try {
            classToMarker.put(mocking.clazz, mocking.markerSupplier.get());
        } finally {
            mockingInProgressClass.remove();
        }

        staticMocks.add(mocking.clazz);
    }
391164
public static Class<?> classFromAsmType(Type type) {
    Optional<Class<?>> maybeClass = objectTypeToClassCache.getUnchecked(type);
    if (!maybeClass.isPresent()) {
      throw new IllegalArgumentException("Could not load: " + type);
    }
    return maybeClass.get();
  }
601185
public void setDataType(String type)  {
        addField(ConfigureNodeFields.type, FormField.Type.text_single);
        setAnswer(ConfigureNodeFields.type.getFieldName(), type);
    }
161519
public void setType(Type type) {
        Type actual = Type.preserveType(this.getType(), type);

        mConversions.clear();
        mExceptionPossible = false;
        if (actual != null) {
            // Prefer cast for initial type for correct operation of
            // setInitialType if a conversion needs to be inserted at the
            // beginning.
            mConversions.add(new Conversion(null, actual, true));
        }
    }
163428
public void setType(int type) {
        this.type = type;
        if(headerAll != null) {
            headerAll.setType(this.type);
        }
        if(headerFirst != null) {
            headerFirst.setType(this.type);
        }
        if(headerLeft != null) {
            headerLeft.setType(this.type);
        }
        if(headerRight != null) {
            headerRight.setType(this.type);
        }
    }
1145677
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);
    }
229935
protected <T> boolean tryToWire(Class<T> type) {
		boolean success = false;
		String className = type.getName();
		Map<String, T> map = getApplicationConfig().applicationContext().getBeansOfType(type);
		if (logger.isDebugEnabled()) {
			logger.debug("Search for '" + className + "' found: " + map);
		}

		if (map.size() == 1) {
			// Got one - wire it in
			Map.Entry entry = map.entrySet().iterator().next();
			String name = (String) entry.getKey();
			AuthenticationManager am = (AuthenticationManager) entry.getValue();

			setAuthenticationManager(am);
			success = true;

			if (logger.isInfoEnabled()) {
				logger.info("Auto-configuration using '" + name
						+ "' as authenticationManager");
			}
		} else if (map.size() > 1) {
			if (logger.isInfoEnabled()) {
				logger.info("Need a single '" + className + "', found: "
						+ map.keySet());
			}
		} else {
			// Size 0, no potentials
			if (logger.isInfoEnabled()) {
				logger.info("Auto-configuration did not find a suitable authenticationManager of type "
						+ type);
			}
		}

		return success;
	}
182659
public static synchronized void mockStatic(Class<?> type, Method... methods) {
        doMock(type, true, new DefaultMockStrategy(), null, methods);
    }
437768
private void init(Class<?> type) {

    ParameterizedType parameterizedType =
      stream(nullSafeArray(type.getGenericInterfaces(), Type.class))
        .filter(this::isParameterizedFunctionType)
        .findFirst()
        .map(it -> (ParameterizedType) it)
        .orElseGet(() -> {

          Type genericSuperclass = type.getGenericSuperclass();

          return isParameterizedFunctionType(genericSuperclass) ? (ParameterizedType) genericSuperclass : null;

        });

    this.sourceType = parameterizedType != null
      ? ClassUtils.toRawType(parameterizedType.getActualTypeArguments()[0])
      : Object.class;

    this.targetType = parameterizedType != null
      ? ClassUtils.toRawType(parameterizedType.getActualTypeArguments()[1])
      : Object.class;
  }
742492
private static <T> TypeReference<T> typeReferenceFrom(final Type type) {
        return new TypeReference<T>() {
            @Override
            public Type getType() {
                return type;
            }
        };
    }
297964
@Nonnull
  public JSInvocation staticInvoke (@Nullable final AbstractJSClass aType, @Nonnull final JSMethod aMethod)
  {
    final JSInvocation aInvocation = new JSInvocation (aType, aMethod);
    return addStatement (aInvocation);
  }
1283343
public static <T> Typed<T> wrap(final Type type) {
        return new Typed<T>() {
            @Override
            public Type getType() {
                return type;
            }
        };
    }