Buggy code:
@ Deprecated public class TestQueryParserWrapper extends LuceneTestCase { public static Analyzer qpAnalyzer = new TestQueryParserWrapper . QPTestAnalyzer ( ) ; public static final class QPTestFilter extends TokenFilter { private final CharTermAttribute termAtt = addAttribute ( CharTermAttribute . class ) ; private final OffsetAttribute offsetAtt = addAttribute ( OffsetAttribute . class ) ; public QPTestFilter ( TokenStream in ) { } boolean inPhrase = false ; int savedStart = 0 ; int savedEnd = 0 ; @ Override public boolean incrementToken ( ) throws IOException { } } public static final class QPTestAnalyzer extends Analyzer { @ Override public final TokenStream tokenStream ( String fieldName , Reader reader ) { } } public static class QPTestParser extends QueryParserWrapper { public QPTestParser ( String f , Analyzer a ) { } @ Override protected Query getFuzzyQuery ( String field , String termStr , float minSimilarity ) throws ParseException { } @ Override protected Query getWildcardQuery ( String field , String termStr ) throws ParseException { } private static class QPTestParserQueryNodeProcessor extends QueryNodeProcessorImpl { @ Override protected QueryNode postProcessNode ( QueryNode node ) throws QueryNodeException { } @ Override protected QueryNode preProcessNode ( QueryNode node ) throws QueryNodeException { } @ Override protected List < QueryNode > setChildrenOrder ( List < QueryNode > children ) throws QueryNodeException { } } } private int originalMaxClauses ; @ Override public void setUp ( ) throws Exception { } public QueryParserWrapper getParser ( Analyzer a ) throws Exception { } public Query getQuery ( String query , Analyzer a ) throws Exception { } public Query getQueryAllowLeadingWildcard ( String query , Analyzer a ) throws Exception { } public void assertQueryEquals ( String query , Analyzer a , String result ) throws Exception { } public void assertQueryEqualsAllowLeadingWildcard ( String query , Analyzer a , String result ) throws Exception { } public void assertQueryEquals ( QueryParserWrapper qp , String field , String query , String result ) throws Exception { } public void assertEscapedQueryEquals ( String query , Analyzer a , String result ) throws Exception { } public void assertWildcardQueryEquals ( String query , boolean lowercase , String result , boolean allowLeadingWildcard ) throws Exception { } public void assertWildcardQueryEquals ( String query , boolean lowercase , String result ) throws Exception { } public void assertWildcardQueryEquals ( String query , String result ) throws Exception { } public Query getQueryDOA ( String query , Analyzer a ) throws Exception { } public void assertQueryEqualsDOA ( String query , Analyzer a , String result ) throws Exception { } public void testCJK ( ) throws Exception { } public void testCJKTerm ( ) throws Exception { } public void testCJKBoostedTerm ( ) throws Exception { } public void testCJKPhrase ( ) throws Exception { } public void testCJKBoostedPhrase ( ) throws Exception { } public void testCJKSloppyPhrase ( ) throws Exception { } public void testSimple ( ) throws Exception { } public void testPunct ( ) throws Exception { } public void testSlop ( ) throws Exception { } public void testNumber ( ) throws Exception { } public void testWildcard ( ) throws Exception { } public void testLeadingWildcardType ( ) throws Exception { } public void testQPA ( ) throws Exception { assertQueryEquals ( "term<seq2seq4repair_space>term^3.0<seq2seq4repair_space>term" , TestQueryParserWrapper . qpAnalyzer , "term<seq2seq4repair_space>term^3.0<seq2seq4repair_space>term" ) ; assertQueryEquals ( "term<seq2seq4repair_space>stop^3.0<seq2seq4repair_space>term" , TestQueryParserWrapper . qpAnalyzer , "term<seq2seq4repair_space>term" ) ; assertQueryEquals ( "term<seq2seq4repair_space>term<seq2seq4repair_space>term" , TestQueryParserWrapper . qpAnalyzer , "term<seq2seq4repair_space>term<seq2seq4repair_space>term" ) ; assertQueryEquals ( "term<seq2seq4repair_space>+stop<seq2seq4repair_space>term" , TestQueryParserWrapper . qpAnalyzer , "term<seq2seq4repair_space>term" ) ; assertQueryEquals ( "term<seq2seq4repair_space>-stop<seq2seq4repair_space>term" , TestQueryParserWrapper . qpAnalyzer , "term<seq2seq4repair_space>term" ) ; assertQueryEquals ( "drop<seq2seq4repair_space>AND<seq2seq4repair_space>(stop)<seq2seq4repair_space>AND<seq2seq4repair_space>roll" , TestQueryParserWrapper . qpAnalyzer , "+drop<seq2seq4repair_space>+roll" ) ; assertQueryEquals ( "term<seq2seq4repair_space>+(stop)<seq2seq4repair_space>term" , TestQueryParserWrapper . qpAnalyzer , "term<seq2seq4repair_space>term" ) ; assertQueryEquals ( "term<seq2seq4repair_space>-(stop)<seq2seq4repair_space>term" , TestQueryParserWrapper . qpAnalyzer , "term<seq2seq4repair_space>term" ) ; assertQueryEquals ( "drop<seq2seq4repair_space>AND<seq2seq4repair_space>stop<seq2seq4repair_space>AND<seq2seq4repair_space>roll" , TestQueryParserWrapper . qpAnalyzer , "+drop<seq2seq4repair_space>+roll" ) ; <START_BUG> assertQueryEquals ( "term<seq2seq4repair_space>phrase<seq2seq4repair_space>term" , TestQueryParserWrapper . qpAnalyzer , "term<seq2seq4repair_space>phrase1<seq2seq4repair_space>phrase2<seq2seq4repair_space>term" ) ; <END_BUG> assertQueryEquals ( "term<seq2seq4repair_space>AND<seq2seq4repair_space>NOT<seq2seq4repair_space>phrase<seq2seq4repair_space>term" , TestQueryParserWrapper . qpAnalyzer , "+term<seq2seq4repair_space>-(phrase1<seq2seq4repair_space>phrase2)<seq2seq4repair_space>term" ) ; assertQueryEquals ( "stop^3" , TestQueryParserWrapper . qpAnalyzer , "" ) ; assertQueryEquals ( "stop" , TestQueryParserWrapper . qpAnalyzer , "" ) ; assertQueryEquals ( "(stop)^3" , TestQueryParserWrapper . qpAnalyzer , "" ) ; assertQueryEquals ( "((stop))^3" , TestQueryParserWrapper . qpAnalyzer , "" ) ; assertQueryEquals ( "(stop^3)" , TestQueryParserWrapper . qpAnalyzer , "" ) ; assertQueryEquals ( "((stop)^3)" , TestQueryParserWrapper . qpAnalyzer , "" ) ; assertQueryEquals ( "(stop)" , TestQueryParserWrapper . qpAnalyzer , "" ) ; assertQueryEquals ( "((stop))" , TestQueryParserWrapper . qpAnalyzer , "" ) ; assertTrue ( ( ( getQuery ( "term<seq2seq4repair_space>term<seq2seq4repair_space>term" , TestQueryParserWrapper . qpAnalyzer ) ) instanceof BooleanQuery ) ) ; assertTrue ( ( ( getQuery ( "term<seq2seq4repair_space>+stop" , TestQueryParserWrapper . qpAnalyzer ) ) instanceof TermQuery ) ) ; } public void testRange ( ) throws Exception { } public void testFarsiRangeCollating ( ) throws Exception { } private String escapeDateString ( String s ) { } private String getLegacyDate ( String s ) throws Exception { } private String getDate ( String s , DateTools . Resolution resolution ) throws Exception { } private String getDate ( Date d , DateTools . Resolution resolution ) throws Exception { } private String getLocalizedDate ( int year , int month , int day ) { } public void testLegacyDateRange ( ) throws Exception { } public void testDateRange ( ) throws Exception { } public void assertDateRangeQueryEquals ( QueryParserWrapper qp , String field , String startDate , String endDate , Date endDateInclusive , DateTools . Resolution resolution ) throws Exception { } public void testEscaped ( ) throws Exception { } public void testQueryStringEscaping ( ) throws Exception { } public void testTabNewlineCarriageReturn ( ) throws Exception { } public void testSimpleDAO ( ) throws Exception { } public void testBoost ( ) throws Exception { } public void assertParseException ( String queryString ) throws Exception { } public void testException ( ) throws Exception { } public void testCustomQueryParserWildcard ( ) { }

Fix:
assertQueryEquals ( "term<seq2seq4repair_space>phrase<seq2seq4repair_space>term" , TestQueryParserWrapper . qpAnalyzer , "term<seq2seq4repair_space>(phrase1<seq2seq4repair_space>phrase2)<seq2seq4repair_space>term" ) ;