class SerializerFactory {

    private static final Map<String, Class<? extends AbstractSerializer>> serializers;

    static {
        serializers = new ConcurrentHashMap<>();
    }

    public static AbstractSerializer serializer(HugeConfig config, String name) {<FILL_FUNCTION_BODY>}

    @SuppressWarnings({"rawtypes", "unchecked"})
    public static void register(String name, String classPath) {
        ClassLoader classLoader = SerializerFactory.class.getClassLoader();
        Class<?> clazz;
        try {
            clazz = classLoader.loadClass(classPath);
        } catch (Exception e) {
            throw new BackendException("Invalid class: '%s'", e, classPath);
        }

        // Check subclass
        if (!AbstractSerializer.class.isAssignableFrom(clazz)) {
            throw new BackendException("Class is not a subclass of class " +
                                       "AbstractSerializer: '%s'", classPath);
        }

        // Check exists
        if (serializers.containsKey(name)) {
            throw new BackendException("Exists serializer: %s(Class '%s')",
                                       name, serializers.get(name).getName());
        }

        // Register class
        serializers.put(name, (Class) clazz);
    }
}

        name = name.toLowerCase();
        switch (name) {
            case "binary":
                return new BinarySerializer(config);
            case "binaryscatter":
                return new BinaryScatterSerializer(config);
            case "text":
                return new TextSerializer(config);
            default:
        }

        Class<? extends AbstractSerializer> clazz = serializers.get(name);
        if (clazz == null) {
            throw new BackendException("Not exists serializer: '%s'", name);
        }

        assert AbstractSerializer.class.isAssignableFrom(clazz);
        try {
            return clazz.getConstructor(HugeConfig.class).newInstance(config);
        } catch (Exception e) {
            throw new BackendException(e);
        }
    
<no_super_class>