private static BellaDatiConnection connect(String baseUrl, boolean trustSelfSigned) {
try {
return (BellaDatiConnection) getConnectionConstructor().newInstance(baseUrl, trustSelfSigned);
} catch (ClassNotFoundException e) {
throw new InvalidImplementationException("Failed to instantiate connection", e);
} catch (NoSuchMethodException e) {
throw new InvalidImplementationException("Failed to instantiate connection", e);
} catch (InvocationTargetException e) {
throw new InvalidImplementationException("Failed to instantiate connection", e);
} catch (IllegalAccessException e) {
throw new InvalidImplementationException("Failed to instantiate connection", e);
} catch (InstantiationException e) {
throw new InvalidImplementationException("Failed to instantiate connection", e);
} catch (IllegalArgumentException e) {
throw new InvalidImplementationException("Failed to instantiate connection", e);
} catch (SecurityException e) {
throw new InvalidImplementationException("Failed to instantiate connection", e);
} catch (ClassCastException e) {
throw new InvalidImplementationException("Failed to instantiate connection", e);
}
}