if(clazz == Void.class) {
if (clazz == null) {
    public static Class getMostCommonSuperclass(Object[] objects) {        Class clazz = Void.class;        boolean found = false;        if (objects != null && objects.length > 0) {            while (!found) {                for (int i = 0; i < objects.length; i++) {                    found = true;                    if (objects[i] != null) {                        Class currentClazz = objects[i].getClass();                        if(clazz == Void.class) {                            clazz = currentClazz;                        }                        if(!clazz.isAssignableFrom(currentClazz)) {                            if(currentClazz.isAssignableFrom(clazz)) {                                clazz = currentClazz;                            } else {                                clazz = clazz.getSuperclass();                                found = false;                                break;                            }                        }                    }                }            }        }        return clazz;    }