@Test
public void checkClassGenerationWithUsingJarFile()
        throws Exception {

    String pathToJar = this.getClass().getClassLoader().getResource("ifield_name.jar").getFile();
    JarFile jarFile = new JarFile(pathToJar);
    Enumeration<JarEntry> e = jarFile.entries();
    URL[] urls = { new URL("jar:file:" + pathToJar+"!/") };
    URLClassLoader cl = URLClassLoader.newInstance(urls);
    while (e.hasMoreElements()) {
        JarEntry je = e.nextElement();
        if(je.isDirectory() || !je.getName().endsWith(".class")){
            continue;
        }
        // -6 because of .class
        String className = je.getName().substring(0,je.getName().length()-6);
        className = className.replace('/', '.');
        Class c = cl.loadClass(className);
    }
    ClassGenerator classGenerator = new ClassGenerator(cl);
    String testSample = "package info.smart_tools.smartactors.utility_tool.test_class;\n" +
            "import info.smart_tools.smartactors.utility_tool.class_generator_with_java_compile_api.TestInterface;\n" +
            "import info.smart_tools.smartactors.core.ifield_name.IFieldName;\n" +
            "public class TestClass implements TestInterface, IFieldName {\n" +
            "    private int a;\n" +
            "    public Integer getA() {\n" +
            "        return a;\n" +
            "    }\n" +
            "}\n";
    Class newClass = classGenerator.generate(testSample);
    assertNotNull(newClass);
}