String resolveTypeConflict(String type1, String type2, Map<String, Map<String, String>> resolutions) {
        // Check if we have an array in either type
        Pattern arrayPattern = Pattern.compile("array<([^>]+)>\\[(\\d+)\\]");
        Matcher matcher1 = arrayPattern.matcher(type1);
        Matcher matcher2 = arrayPattern.matcher(type2);

        Integer type1arraySize = null;
        Integer type2arraySize = null;
        String type1baseType = null;
        String type2baseType = null;
        if (matcher1.matches()) {
            type1arraySize = Integer.parseInt(matcher1.group(2));
            type1baseType = matcher1.group(1);
        }
        if (matcher2.matches()) {
            type2arraySize = Integer.parseInt(matcher2.group(2));
            type2baseType = matcher2.group(1);
        }
        
        // two arrays?
        if (type1arraySize != null && type2arraySize != null) {
            // If base types are the same but array sizes differ, use variablearray
            if (type1baseType.equals(type2baseType)) {
                return "variablearray<" + type1baseType + ">";
            } else {
                // see if we can resolve the base types
                String resolvedBaseType = getBaseResolvedType(type1baseType, type2baseType, resolutions);
                // if we can, return a variablearray with the resolved base type
                if (resolvedBaseType != null) {
                    return "variablearray<" + resolvedBaseType + ">";
                } else {
                    // otherwise, we can't resolve the conflict
                    return null;
                }
            }
        }

        // one array and one non-array?
        // look up the resolutions without the array size
        if (type1arraySize != null) {
            String resolvedBaseType = getBaseResolvedType("array<" + type1baseType + ">", type2, resolutions);
            // if the result is an array, return it with the array size
            if (resolvedBaseType != null && resolvedBaseType.startsWith("array<")) {
                return resolvedBaseType + "[" + type1arraySize + "]";
            } else {
                // otherwise, we return the resolved type as is
                return resolvedBaseType;
            }
        }
        // same logic as above
        if (type2arraySize != null) {
            String resolvedBaseType = getBaseResolvedType("array<" + type2baseType + ">", type1, resolutions);
            if (resolvedBaseType != null && resolvedBaseType.startsWith("array<")) {
                return resolvedBaseType + "[" + type2arraySize + "]";
            } else {
                return resolvedBaseType;
            }
        }

        // two non-array types?
        // just look them up in the resolutions
        return getBaseResolvedType(type1, type2, resolutions);
    }
Resolves a type conflict between two Vespa field types.
Uses the type conflict resolution rules defined in the type_conflict_resolution.yml file.
If no resolution is found, returns null.

@param type1 First Vespa field type
@param type2 Second Vespa field type
@return The resolved type, or null if no resolution is found
integration/logstash-plugins/logstash-output-vespa/src/main/java/org/logstashplugins/VespaAppPackageWriter.java