private static Class getClassMatchingAllChildren(OgnlContext context, Node[] _children) {
        Class[] cc = getChildrenClasses(context, _children);
        Class componentType = null;
        for (int j = 0; j < cc.length; j++) {
            Class ic = cc[j];
            if (ic == null) {
                componentType = Object.class; // fall back to object...
                break;
            } else {
                if (componentType == null) {
                    componentType = ic;
                } else {
                    if (!componentType.isAssignableFrom(ic)) {
                        if (ic.isAssignableFrom(componentType)) {
                            componentType = ic; // just swap... ic is more generic...
                        } else {
                            Class pc;
                            while ((pc = componentType.getSuperclass()) != null) { // TODO hmm - it could also be that an interface matches...
                                if (pc.isAssignableFrom(ic)) {
                                    componentType = pc; // use this matching parent class
                                    break;
                                }
                            }
                            if (!componentType.isAssignableFrom(ic)) {
                                // parents didn't match. the types might be primitives. Fall back to object.
                                componentType = Object.class;
                                break;
                            }
                        }
                    }
                }
            }
        }
        if (componentType == null)
            componentType = Object.class;
        return componentType;
    }