#vulnerable code 
                                @Test
    public void hasNot() throws IOException {
        BaseConfiguration config = new BaseConfiguration();
        config.addProperty(Graph.GRAPH, ElasticGraph.class.getName());
        config.addProperty("elasticsearch.cluster.name", "test2");
        String indexName = "graph2";
        config.addProperty("elasticsearch.index.name", indexName.toLowerCase());
        config.addProperty("elasticsearch.local", true);
        config.addProperty("elasticsearch.refresh", true);
        config.addProperty("elasticsearch.client", "NODE");
        ElasticGraph graph = new ElasticGraph(config);
        ((DefaultSchemaProvider)graph.elasticService.schemaProvider).clearAllData();
        Vertex vertex = graph.addVertex(T.label, "test_doc", T.id, "1", "name", "eliran", "age", 24);
        Vertex vertex1 = graph.addVertex(T.label, "test_doc", T.id, "2", "name", "ran");
        Vertex vertex2 = graph.addVertex(T.label, "test_doc", T.id, "3", "name", "chiko");
        Vertex vertex3 = graph.addVertex(T.label, "test_doc", T.id, "4", "name", "medico");
        vertex2.addEdge("heardof",vertex,T.id,"111");
        vertex.addEdge("knows",vertex1);
        vertex.addEdge("heardof",vertex3);
        //graph.V("1").outE("heardof").next();
        //vertex1.addEdge("knows",vertex);
        Element knows = graph.E("111").has(T.label, "heardof").next();

        Object out = graph.V("1").out().next();
        Object in = graph.V("1").in().next();
        int i=1;

    } 
                            #location 25 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void hasNot() throws IOException {
        BaseConfiguration config = new BaseConfiguration();
        config.addProperty("elasticsearch.cluster.name", "test");
        config.addProperty("elasticsearch.index.name", "graph");
        config.addProperty("elasticsearch.refresh", true);
        config.addProperty("elasticsearch.client", ElasticService.ClientType.NODE);

        ElasticGraph graph = new ElasticGraph(config);
        ((DefaultSchemaProvider)graph.elasticService.schemaProvider).clearAllData();

        Vertex vertex = graph.addVertex(T.label, "test_doc", T.id, "1", "name", "eliran", "age", 24);
        Vertex vertex1 = graph.addVertex(T.label, "test_doc", T.id, "2", "name", "ran");
        Vertex vertex2 = graph.addVertex(T.label, "test_doc", T.id, "3", "name", "chiko");
        Vertex vertex3 = graph.addVertex(T.label, "test_doc", T.id, "4", "name", "medico");
        vertex2.addEdge("heardof",vertex,T.id,"111");
        vertex.addEdge("knows",vertex1);
        vertex.addEdge("heardof",vertex3);
        //graph.V("1").outE("heardof").next();
        //vertex1.addEdge("knows",vertex);
        Element knows = graph.E("111").has(T.label, "heardof").next();

        Object out = graph.V("1").out().next();
        Object in = graph.V("1").in().next();
        int i=1;

        graph.close();

    }