@SuppressWarnings("unchecked")
    public <T> Serializer<? super T> getSerializerForClass(Class<T> clazz) {
        if (clazz.isArray()) {
            return ARRAY_SERIALIZER;
        } else if (serializerClassMap.containsKey(clazz)) {
            return serializerClassMap.get(clazz);
        } else if (!clazz.isEnum() && clazz.getSuperclass() != null && clazz.getSuperclass() != Object.class) {
            return getSerializerForClass(clazz.getSuperclass());
        }
        throw new IllegalArgumentException("Type not supported " + clazz.getName());
    }