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

        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/patch-magisk/bridge/src/main/java/github/tornaco/android/thanox/magisk/bridge/util/ReflectionUtils.java