// Path: neo4j-jdbc-http/src/main/java/org/neo4j/jdbc/http/driver/Neo4jStatement.java
// public class Neo4jStatement {
// 
// 	/**
// 	 * Cypher query.
// 	 */
// 	public final String statement;
// 
// 	/**
// 	 * Params of the cypher query.
// 	 */
// 	public final Map<String, Object> parameters;
// 
// 	/**
// 	 * Do we need to include stats with the query ?
// 	 */
// 	public final Boolean includeStats;
// 
// 	/**
// 	 * Default constructor.
// 	 *
// 	 * @param statement    Cypher query
// 	 * @param parameters   List of named params for the cypher query
// 	 * @param includeStats Do we need to include stats
// 	 * @throws SQLException sqlexception
// 	 */
// 	public Neo4jStatement(String statement, Map<String, Object> parameters, Boolean includeStats) throws SQLException {
// 		if (statement != null && !"".equals(statement)) {
// 			this.statement = statement;
// 		} else {
// 			throw new SQLException("Creating a NULL query");
// 		}
// 		if (parameters != null) {
// 			this.parameters = parameters;
// 		} else {
// 			this.parameters = new HashMap<>();
// 		}
// 		if (includeStats != null) {
// 			this.includeStats = includeStats;
// 		} else {
// 			this.includeStats = Boolean.FALSE;
// 		}
// 	}
// 
// 	/**
// 	 * Convert the list of query to a JSON compatible with Neo4j endpoint.
// 	 *
// 	 * @param queries List of cypher queries.
// 	 * @param mapper mapper
// 	 * @return The JSON string that correspond to the body of the API call
// 	 * @throws SQLException sqlexception
// 	 */
// 	public static String toJson(List<Neo4jStatement> queries, ObjectMapper mapper) throws SQLException {
// 		StringBuilder sb = new StringBuilder();
// 		try {
// 			sb.append("{\"statements\":");
// 			sb.append(mapper.writeValueAsString(queries));
// 			sb.append("}");
// 
// 		} catch (JsonProcessingException e) {
// 			throw new SQLException("Can't convert Cypher statement(s) into JSON", e);
// 		}
// 		return sb.toString();
// 	}
// 
// 	/**
// 	 * Getter for Statements.
// 	 * We escape the string for the API.
// 	 * 
// 	 * @return the statement
// 	 */
// 	public String getStatement() {
// 		return statement;
// 	}
// 
// }


import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.opencsv.CSVParserBuilder;
import com.opencsv.CSVReader;
import com.opencsv.CSVReaderBuilder;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.rules.ExpectedException;
import org.neo4j.jdbc.http.driver.Neo4jStatement;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.stream.Collectors;
		List<Neo4jStatement> queriesObj = new ArrayList<>();
		List<String[]> queriesCsv = new ArrayList<>();

		File csv = new File(getClass().getClassLoader().getResource(filename).getFile());
		CSVReader reader = new CSVReaderBuilder(new FileReader(csv))
				.withCSVParser(new CSVParserBuilder()
						.withQuoteChar('"')
						.withSeparator(';')
						.build())
				.build();
		List<String[]> entries = reader.readAll();
		entries.remove(0); // remove headers

		if (nbElement > 0) {
			Random random = new Random();
			for (int i = 0; i < nbElement; i++) {
				Integer id = random.nextInt(entries.size());
				String[] line = entries.get(id);
				queriesObj.add(transformCsvLineToNeo4jStatement(line));
				queriesCsv.add(line);
			}
		} else {
			for (String[] line : entries) {
				queriesObj.add(transformCsvLineToNeo4jStatement(line));
				queriesCsv.add(line);
			}
		}

		Map<String, List> result = new HashMap<>();
		result.put("source", queriesCsv);
// Path: neo4j-jdbc-http/src/main/java/org/neo4j/jdbc/http/driver/Neo4jStatement.java
// public class Neo4jStatement {
// 
// 	/**
// 	 * Cypher query.
// 	 */
// 	public final String statement;
// 
// 	/**
// 	 * Params of the cypher query.
// 	 */
// 	public final Map<String, Object> parameters;
// 
// 	/**
// 	 * Do we need to include stats with the query ?
// 	 */
// 	public final Boolean includeStats;
// 
// 	/**
// 	 * Default constructor.
// 	 *
// 	 * @param statement    Cypher query
// 	 * @param parameters   List of named params for the cypher query
// 	 * @param includeStats Do we need to include stats
// 	 * @throws SQLException sqlexception
// 	 */
// 	public Neo4jStatement(String statement, Map<String, Object> parameters, Boolean includeStats) throws SQLException {
// 		if (statement != null && !"".equals(statement)) {
// 			this.statement = statement;
// 		} else {
// 			throw new SQLException("Creating a NULL query");
// 		}
// 		if (parameters != null) {
// 			this.parameters = parameters;
// 		} else {
// 			this.parameters = new HashMap<>();
// 		}
// 		if (includeStats != null) {
// 			this.includeStats = includeStats;
// 		} else {
// 			this.includeStats = Boolean.FALSE;
// 		}
// 	}
// 
// 	/**
// 	 * Convert the list of query to a JSON compatible with Neo4j endpoint.
// 	 *
// 	 * @param queries List of cypher queries.
// 	 * @param mapper mapper
// 	 * @return The JSON string that correspond to the body of the API call
// 	 * @throws SQLException sqlexception
// 	 */
// 	public static String toJson(List<Neo4jStatement> queries, ObjectMapper mapper) throws SQLException {
// 		StringBuilder sb = new StringBuilder();
// 		try {
// 			sb.append("{\"statements\":");
// 			sb.append(mapper.writeValueAsString(queries));
// 			sb.append("}");
// 
// 		} catch (JsonProcessingException e) {
// 			throw new SQLException("Can't convert Cypher statement(s) into JSON", e);
// 		}
// 		return sb.toString();
// 	}
// 
// 	/**
// 	 * Getter for Statements.
// 	 * We escape the string for the API.
// 	 * 
// 	 * @return the statement
// 	 */
// 	public String getStatement() {
// 		return statement;
// 	}
// 
// }


// Path: neo4j-jdbc-http/src/test/java/org/neo4j/jdbc/http/test/Neo4jHttpUnitTestUtil.java
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.opencsv.CSVParserBuilder;
import com.opencsv.CSVReader;
import com.opencsv.CSVReaderBuilder;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.rules.ExpectedException;
import org.neo4j.jdbc.http.driver.Neo4jStatement;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.stream.Collectors;

		List<Neo4jStatement> queriesObj = new ArrayList<>();
		List<String[]> queriesCsv = new ArrayList<>();

		File csv = new File(getClass().getClassLoader().getResource(filename).getFile());
		CSVReader reader = new CSVReaderBuilder(new FileReader(csv))
				.withCSVParser(new CSVParserBuilder()
						.withQuoteChar('"')
						.withSeparator(';')
						.build())
				.build();
		List<String[]> entries = reader.readAll();
		entries.remove(0); // remove headers

		if (nbElement > 0) {
			Random random = new Random();
			for (int i = 0; i < nbElement; i++) {
				Integer id = random.nextInt(entries.size());
				String[] line = entries.get(id);
				queriesObj.add(transformCsvLineToNeo4jStatement(line));
				queriesCsv.add(line);
			}
		} else {
			for (String[] line : entries) {
				queriesObj.add(transformCsvLineToNeo4jStatement(line));
				queriesCsv.add(line);
			}
		}

		Map<String, List> result = new HashMap<>();
		result.put("source", queriesCsv);
		result.put("object", queriesObj);