class ServientConfig {

    static Pair<String, ProtocolClientFactory> initializeClientFactory(Config config,
                                                                       String factoryName) throws ServientConfigException {
        try {
            Class<ProtocolClientFactory> factoryKlass = (Class<ProtocolClientFactory>) Class.forName(factoryName);
            Constructor<ProtocolClientFactory> constructor;
            ProtocolClientFactory factory;
            if (hasConstructor(factoryKlass, Config.class)) {
                constructor = factoryKlass.getConstructor(Config.class);
                factory = constructor.newInstance(config);
            }
            else {
                constructor = factoryKlass.getConstructor();
                factory = constructor.newInstance();
            }
            return new Pair<>(factory.getScheme(), factory);
        }
        catch (ClassCastException | ClassNotFoundException | NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
            throw new ServientConfigException(e);
        }
    }

      ServientConfig(List<ProtocolServer> servers,
                   Map<String, ProtocolClientFactory> clientFactories,
                   Map<String, Object> credentialStore);
    public  ServientConfig(Config config);

}