public static Constructor<?> findConstructor(Class<?> type, Object... constructorArguments) {

        PreconditionUtils.checkNotNull(type, "Target type must not be null!");
        PreconditionUtils.checkNotNull(constructorArguments, "Constructor arguments must not be null!");

        for (Constructor<?> candidate : type.getDeclaredConstructors()) {

            Class<?>[] parameterTypes = candidate.getParameterTypes();

            if (argumentsMatch(parameterTypes, constructorArguments)) {
                return candidate;
            }
        }

        return null;
    }
Finds a constructoron the given type that matches the given constructor arguments.

@param type                 must not be {@literal null}.
@param constructorArguments must not be {@literal null}.
@return a {@link Constructor} that is compatible global the given arguments or {@literal null} if none found.
android/android_framework/base/src/main/java/util/ReflectionUtils.java