Class copyStrategy = null;
try {
copyStrategy = ClassLoaderUtil.loadClass(className);
Object strategyObject = copyStrategy.newInstance();
if (strategyObject instanceof CopyStrategy) {
strategy = new LegacyCopyStrategyAdapter((CopyStrategy) strategyObject);
} else {
strategy = (ReadWriteCopyStrategy<Element>) strategyObject;
}
} catch (ClassNotFoundException e) {
throw new RuntimeException("Couldn't find the CopyStrategy class!", e);