public static List<TypedExpression> coerceCorrectConstructorArguments(
            final Class<?> type,
            List<TypedExpression> arguments,
            List<Integer> emptyCollectionArgumentsIndexes) {
        Objects.requireNonNull(type, "Type parameter cannot be null as the method searches constructors from that class!");
        Objects.requireNonNull(arguments, "Arguments parameter cannot be null! Use an empty list instance if needed instead.");
        Objects.requireNonNull(emptyCollectionArgumentsIndexes, "EmptyListArgumentIndexes parameter cannot be null! Use an empty list instance if needed instead.");
        if (emptyCollectionArgumentsIndexes.size() > arguments.size()) {
            throw new IllegalArgumentException("There cannot be more empty collection arguments than all arguments! emptyCollectionArgumentsIndexes parameter has more items than arguments parameter. "
                    + "(" + emptyCollectionArgumentsIndexes.size() + " > " + arguments.size() + ")");
        }
        // Rather work only with the argumentsType and when a method is resolved, flip the arguments list based on it.
        final List<TypedExpression> coercedArgumentsTypesList = new ArrayList<>(arguments);
        Constructor<?> constructor = resolveConstructor(type, coercedArgumentsTypesList);
        if (constructor != null) {
            return coercedArgumentsTypesList;
        } else {
            // This needs to go through all possible combinations.
            final int indexesListSize = emptyCollectionArgumentsIndexes.size();
            for (int numberOfProcessedIndexes = 0; numberOfProcessedIndexes < indexesListSize; numberOfProcessedIndexes++) {
                for (int indexOfEmptyListIndex = numberOfProcessedIndexes; indexOfEmptyListIndex < indexesListSize; indexOfEmptyListIndex++) {
                    switchCollectionClassInArgumentsByIndex(coercedArgumentsTypesList, emptyCollectionArgumentsIndexes.get(indexOfEmptyListIndex));
                    constructor = resolveConstructor(type, coercedArgumentsTypesList);
                    if (constructor != null) {
                        return coercedArgumentsTypesList;
                    }
                    switchCollectionClassInArgumentsByIndex(coercedArgumentsTypesList, emptyCollectionArgumentsIndexes.get(indexOfEmptyListIndex));
                }
                switchCollectionClassInArgumentsByIndex(coercedArgumentsTypesList, emptyCollectionArgumentsIndexes.get(numberOfProcessedIndexes));
            }
            // No constructor found, return the original arguments.
            return arguments;
        }
    }
@Test
    public void coerceCorrectConstructorArgumentsList() {
        final List<TypedExpression> arguments = List.of(new ListExprT(new ListCreationLiteralExpression(null, NodeList.nodeList())));
        final List<TypedExpression> coercedArguments = MethodResolutionUtils.coerceCorrectConstructorArguments(
                Person.class, arguments, List.of(0));
        Assertions.assertThat(coercedArguments).containsExactlyElementsOf(arguments);
    }