// Path: src/main/java/certh/iti/mklab/easie/configuration/Configuration.java
// public static class ScrapableField {
// 
//     public Object label;
// 
//     public Object value;
// 
//     public Object citeyear;
// 
//     public void setLabel(ExtractionProperties ep) {
//         label = ep;
//     }
// 
//     public void setValue(ExtractionProperties ep) {
//         value = ep;
//     }
// 
//     public void setCiteyear(ExtractionProperties ep) {
//         citeyear = ep;
//     }
// }
// 
// Path: src/main/java/certh/iti/mklab/easie/extractors/AbstractHTMLExtractor.java
// public abstract class AbstractHTMLExtractor {
//    
//    public abstract List extractFields(List<ScrapableField> fields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
//    
//    public abstract List extractTable(String tableSelector, List<ScrapableField> fields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
//    
//    public abstract Pair extractFields(List<ScrapableField> cfields, List<ScrapableField> sfields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
//    
//    public abstract Pair extractTable(String tableSelector, List<ScrapableField> cfields, List<ScrapableField> sfields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
// }


import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang3.tuple.Pair;
import org.bson.Document;
import certh.iti.mklab.easie.configuration.Configuration.ScrapableField;
import certh.iti.mklab.easie.extractors.AbstractHTMLExtractor;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

        ArrayList<Document> extractedFields = new ArrayList();

        Iterator links = group_of_urls.iterator();
        ExecutorService executorService = Executors.newFixedThreadPool(numThreads);

        List<Future<ArrayList>> handles = new ArrayList<Future<ArrayList>>();
        while (links.hasNext()) {
            handles.add(executorService.submit(new SingleStaticPageExtractor(
                    base_url + links.next().toString().replace(base_url, ""),
                    tableSelector,
                    null,
                    fields
            )));
        }
        for (int t = 0, n = handles.size(); t < n; t++) {
            try {
                extractedFields.addAll(handles.get(t).get());
            } catch (ExecutionException ex) {
                Logger.getLogger(StaticHTMLExtractor.class.getName()).log(Level.SEVERE, null, ex);
            } catch (InterruptedException ex) {
                Logger.getLogger(StaticHTMLExtractor.class.getName()).log(Level.SEVERE, null, ex);
            } catch (NoSuchElementException ex) {
                Logger.getLogger(StaticHTMLExtractor.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        executorService.shutdownNow();
        return extractedFields;
    }

    @Override

// Path: src/main/java/certh/iti/mklab/easie/configuration/Configuration.java
// public static class ScrapableField {
// 
//     public Object label;
// 
//     public Object value;
// 
//     public Object citeyear;
// 
//     public void setLabel(ExtractionProperties ep) {
//         label = ep;
//     }
// 
//     public void setValue(ExtractionProperties ep) {
//         value = ep;
//     }
// 
//     public void setCiteyear(ExtractionProperties ep) {
//         citeyear = ep;
//     }
// }
// 
// Path: src/main/java/certh/iti/mklab/easie/extractors/AbstractHTMLExtractor.java
// public abstract class AbstractHTMLExtractor {
//    
//    public abstract List extractFields(List<ScrapableField> fields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
//    
//    public abstract List extractTable(String tableSelector, List<ScrapableField> fields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
//    
//    public abstract Pair extractFields(List<ScrapableField> cfields, List<ScrapableField> sfields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
//    
//    public abstract Pair extractTable(String tableSelector, List<ScrapableField> cfields, List<ScrapableField> sfields) throws URISyntaxException, IOException, InterruptedException, KeyManagementException;
// }


// Path: src/main/java/certh/iti/mklab/easie/extractors/staticpages/GroupHTMLExtractor.java
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang3.tuple.Pair;
import org.bson.Document;
import certh.iti.mklab.easie.configuration.Configuration.ScrapableField;
import certh.iti.mklab.easie.extractors.AbstractHTMLExtractor;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

        ArrayList<Document> extractedFields = new ArrayList();

        Iterator links = group_of_urls.iterator();
        ExecutorService executorService = Executors.newFixedThreadPool(numThreads);

        List<Future<ArrayList>> handles = new ArrayList<Future<ArrayList>>();
        while (links.hasNext()) {
            handles.add(executorService.submit(new SingleStaticPageExtractor(
                    base_url + links.next().toString().replace(base_url, ""),
                    tableSelector,
                    null,
                    fields
            )));
        }
        for (int t = 0, n = handles.size(); t < n; t++) {
            try {
                extractedFields.addAll(handles.get(t).get());
            } catch (ExecutionException ex) {
                Logger.getLogger(StaticHTMLExtractor.class.getName()).log(Level.SEVERE, null, ex);
            } catch (InterruptedException ex) {
                Logger.getLogger(StaticHTMLExtractor.class.getName()).log(Level.SEVERE, null, ex);
            } catch (NoSuchElementException ex) {
                Logger.getLogger(StaticHTMLExtractor.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        executorService.shutdownNow();
        return extractedFields;
    }

    @Override

    public Pair extractFields(List<ScrapableField> cfields, List<ScrapableField> sfields) throws InterruptedException {
