    @Test
    public void testQueryCreation() throws IOException {

        //Get queries file
        Connection con = new Connection();
        con.setName("a");
        con.setEndpoint("http://test.com");
        Worker worker = getWorker(con, 1, "1");
        InstancesQueryHandler qh = new InstancesQueryHandler(Lists.newArrayList(worker));
        qh.setOutputFolder(this.dir);
        Map<String, File[]> map = qh.generate();
        //check if folder exist this.dir/hashCode/ with |queries| files
        int hashcode = org.aksw.iguana.cc.utils.FileUtils.getHashcodeFromFileContent(this.queriesFile.getAbsolutePath());
        File f = new File(this.dir+File.separator+hashcode);
        assertTrue(f.isDirectory());
        int expectedNoOfFiles = queryStr.length;
        assertEquals(expectedNoOfFiles, f.listFiles().length);
        //iterate through all and check if correct
        HashSet<String> files = new HashSet<String>();
        for(File queryFile : f.listFiles()){
            int id = Integer.parseInt(queryFile.getName().replace("sparql", "").replace("update", ""));
            String actualQueryString =org.aksw.iguana.cc.utils.FileUtils.readLineAt(0, queryFile);
            assertEquals(queryStr[id], actualQueryString);
            files.add(queryFile.getAbsolutePath());
        }
        for(File queryFile : map.get(this.queriesFile.getAbsolutePath())){
            assertTrue(files.contains(queryFile.getAbsolutePath()));
        }
        assertEquals(files.size(), map.get(this.queriesFile.getAbsolutePath()).length);
        FileUtils.deleteDirectory(f);
    }