### Question:
StatementSplitter { public static String squeezeStatement(String sql) { TokenSource tokens = getLexer(sql, ImmutableSet.of()); StringBuilder sb = new StringBuilder(); while (true) { Token token = tokens.nextToken(); if (token.getType() == Token.EOF) { break; } if (token.getType() == SqlBaseLexer.WS) { sb.append(' '); } else { sb.append(token.getText()); } } return sb.toString().trim(); } StatementSplitter(String sql);  StatementSplitter(String sql, Set<String> delimiters); List<Statement> getCompleteStatements(); String getPartialStatement(); static String squeezeStatement(String sql); static boolean isEmptyStatement(String sql); static TokenSource getLexer(String sql, Set<String> terminators);  }### Answer:
@Test public void testSqueezeStatement() { String sql = "select * from\n foo\n order by x ; "; assertEquals(squeezeStatement(sql), "select * from foo order by x ;"); }
@Test public void testSqueezeStatementWithIncompleteQuotedString() { String sql = "select * from\n foo\n where x = 'oops"; assertEquals(squeezeStatement(sql), "select * from foo where x = 'oops"); }
@Test public void testSqueezeStatementWithBackquote() { String sql = "select ` f``o o`` ` from dual"; assertEquals(squeezeStatement(sql), "select ` f``o o`` ` from dual"); }
@Test public void testSqueezeStatementAlternateDelimiter() { String sql = "select * from\n foo\n order by x assertEquals(squeezeStatement(sql), "select * from foo order by x }
@Test public void testSqueezeStatementError() { String sql = "select * from z#oops"; assertEquals(squeezeStatement(sql), "select * from z#oops"); }