### Question:
Statements { public List<Statement> getStatements() { return statements; }  List<Statement> getStatements(); void setStatements(List<Statement> statements); void accept(StatementVisitor statementVisitor); @Override String toString();  }### Answer:
@Test public void testStatementsErrorRecovery() throws JSQLParserException, ParseException { String sqls = "select * from mytable; select * from;"; CCJSqlParser parser = new CCJSqlParser(new StringReader(sqls)); parser.setErrorRecovery(true); Statements parseStatements = parser.Statements(); assertEquals(2, parseStatements.getStatements().size()); assertTrue(parseStatements.getStatements().get(0) instanceof Select); assertNull(parseStatements.getStatements().get(1)); }
@Test public void testStatementsErrorRecovery2() throws JSQLParserException, ParseException { String sqls = "select * from1 table;"; CCJSqlParser parser = new CCJSqlParser(new StringReader(sqls)); parser.setErrorRecovery(true); Statements parseStatements = parser.Statements(); assertEquals(1, parseStatements.getStatements().size()); assertTrue(parseStatements.getStatements().get(0) instanceof Select); assertEquals(1,parser.getParseErrors().size()); }
@Test public void testStatementsErrorRecovery3() throws JSQLParserException, ParseException { String sqls = "select * from mytable; select * from;select * from mytable2"; CCJSqlParser parser = new CCJSqlParser(new StringReader(sqls)); parser.setErrorRecovery(true); Statements parseStatements = parser.Statements(); assertEquals(2, parseStatements.getStatements().size()); assertTrue(parseStatements.getStatements().get(0) instanceof Select); assertNull(parseStatements.getStatements().get(1)); assertEquals(2,parser.getParseErrors().size()); }