@SuppressWarnings("rawtypes")
    protected boolean isEnum(Class clazz, Object obj) {
        if (!clazz.isEnum()) {
            return false;
        }
        for (Object constant : clazz.getEnumConstants()) {
            if (constant.equals(obj)) {
                return true;
            }
        }
        return false;
    }