@Override
  public InterpreterResult interpret(String cypherQuery, InterpreterContext interpreterContext) {
    LOGGER.info("Opening session");
    if (StringUtils.isBlank(cypherQuery)) {
      return new InterpreterResult(Code.SUCCESS);
    }
    final List<String> queries = isMultiStatementEnabled ?
            Arrays.asList(cypherQuery.split(";[^'|^\"|^(\\w+`)]")) : Arrays.asList(cypherQuery);
    if (queries.size() == 1) {
      final String query = queries.get(0);
      return runQuery(query, interpreterContext);
    } else {
      final int lastIndex = queries.size() - 1;
      final List<String> subQueries = queries.subList(0, lastIndex);
      for (String query : subQueries) {
        runQuery(query, interpreterContext);
      }
      return runQuery(queries.get(lastIndex), interpreterContext);
    }
  }
@Test
  void testMultiLineInterpreter() {
    Properties p = new Properties();
    p.setProperty(Neo4jConnectionManager.NEO4J_SERVER_URL, neo4jContainer.getBoltUrl());
    p.setProperty(Neo4jConnectionManager.NEO4J_AUTH_TYPE, Neo4jAuthType.NONE.toString());
    p.setProperty(Neo4jConnectionManager.NEO4J_MAX_CONCURRENCY, "50");
    p.setProperty(Neo4jCypherInterpreter.NEO4J_MULTI_STATEMENT, "true");
    Neo4jCypherInterpreter multiLineInterpreter = new Neo4jCypherInterpreter(p);
    context = InterpreterContext.builder()
            .setInterpreterOut(new InterpreterOutput())
            .build();
    InterpreterResult result = multiLineInterpreter.interpret("CREATE (n:Node{name: ';'});" +
            "\nRETURN 1 AS val;", context);
    assertEquals(Code.SUCCESS, result.code());
    assertEquals("val\n1\n",
            result.toString().replace(TABLE_RESULT_PREFIX, StringUtils.EMPTY));
    result = multiLineInterpreter.interpret("CREATE (n:Node{name: \";\"}); " +
            "RETURN 2 AS `other;Val`;", context);
    assertEquals(Code.SUCCESS, result.code());
    assertEquals("other;Val\n2\n",
            result.toString().replace(TABLE_RESULT_PREFIX, StringUtils.EMPTY));
    result = multiLineInterpreter.interpret("match (n:Node{name: ';'}) " +
            "return count(n) AS count", context);
    assertEquals("count\n2\n",
            result.toString().replace(TABLE_RESULT_PREFIX, StringUtils.EMPTY));
    result = multiLineInterpreter.interpret("match (n:Node) detach delete n; " +
            "match (n:Node) return count(n) AS count", context);
    assertEquals("count\n0\n",
            result.toString().replace(TABLE_RESULT_PREFIX, StringUtils.EMPTY));
  }