### Question:
AlgorithmJarLoader { public Algorithm loadAlgorithm(String filePath) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { String pathToFolder = Thread.currentThread().getContextClassLoader().getResource(Constants.ALGORITHMS_RESOURCE_NAME + Constants.FILE_SEPARATOR + filePath) .getPath(); File file = new File(URLDecoder.decode(pathToFolder, Constants.FILE_ENCODING)); JarFile jar = new JarFile(file); Manifest man = jar.getManifest(); Attributes attr = man.getMainAttributes(); String className = attr.getValue(Constants.BOOTRSTAP_CLASS_TAG_NAME); URL[] url = {file.toURI().toURL()}; ClassLoader loader = new URLClassLoader(url, Algorithm.class.getClassLoader()); Class<? extends Algorithm> algorithmClass = Class.forName(className, true, loader).asSubclass(Algorithm.class); jar.close(); return algorithmClass.getConstructor().newInstance(); }  Algorithm loadAlgorithm(String filePath);  }### Answer:
@Test public void loadAlgorithm() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, SecurityException, InvocationTargetException, NoSuchMethodException, AlgorithmExecutionException { AlgorithmJarLoader loader = new AlgorithmJarLoader(); Algorithm algorithm = loader.loadAlgorithm("example_ucc_algorithm.jar"); assertNotNull(algorithm); assertTrue(algorithm instanceof UniqueColumnCombinationsAlgorithm); assertEquals(ExampleAlgorithm.AUTHORS, algorithm.getAuthors()); assertEquals(ExampleAlgorithm.DESCRIPTION, algorithm.getDescription()); UniqueColumnCombinationsAlgorithm uccAlgorithm = (UniqueColumnCombinationsAlgorithm) algorithm; uccAlgorithm.setResultReceiver(mock(OmniscientResultReceiver.class)); algorithm.execute(); }