Buggy code:
public class CheckHits { public static float EXPLAIN_SCORE_TOLERANCE_DELTA = 0.001F ; public static void checkNoMatchExplanations ( Query q , String defaultFieldName , IndexSearcher searcher , int [ ] results ) throws IOException { } public static void checkHitCollector ( Random random , Query query , String defaultFieldName , IndexSearcher searcher , int [ ] results ) throws IOException { } public static class SetCollector extends Collector { final Set < Integer > bag ; public SetCollector ( Set < Integer > bag ) { } private int base = 0 ; @ Override public void setScorer ( Scorer scorer ) throws IOException { } @ Override public void collect ( int doc ) { } @ Override public void setNextReader ( AtomicReaderContext context ) { } @ Override public boolean acceptsDocsOutOfOrder ( ) { } } public static void checkHits ( Random random , Query query , String defaultFieldName , IndexSearcher searcher , int [ ] results ) throws IOException { } public static void checkDocIds ( String mes , int [ ] results , ScoreDoc [ ] hits ) throws IOException { } public static void checkHitsQuery ( Query query , ScoreDoc [ ] hits1 , ScoreDoc [ ] hits2 , int [ ] results ) throws IOException { } public static void checkEqual ( Query query , ScoreDoc [ ] hits1 , ScoreDoc [ ] hits2 ) throws IOException { } public static String hits2str ( ScoreDoc [ ] hits1 , ScoreDoc [ ] hits2 , int start , int end ) throws IOException { } public static String topdocsString ( TopDocs docs , int start , int end ) { } public static void checkExplanations ( Query query , String defaultFieldName , IndexSearcher searcher ) throws IOException { } public static void checkExplanations ( Query query , String defaultFieldName , IndexSearcher searcher , boolean deep ) throws IOException { } private static float explainToleranceDelta ( float f1 , float f2 ) { <START_BUG> return ( Math . max ( f1 , f2 ) ) * ( CheckHits . EXPLAIN_SCORE_TOLERANCE_DELTA ) ; <END_BUG> } public static void verifyExplanation ( String q , int doc , float score , boolean deep , Explanation expl ) { } public static class ExplanationAssertingSearcher extends IndexSearcher { public ExplanationAssertingSearcher ( Directory d ) throws IOException { } public ExplanationAssertingSearcher ( IndexReader r ) throws IOException { } protected void checkExplanations ( Query q ) throws IOException { } @ Override public TopFieldDocs search ( Query query , Filter filter , int n , Sort sort ) throws IOException { } @ Override public void search ( Query query , Collector results ) throws IOException { } @ Override public void search ( Query query , Filter filter , Collector results ) throws IOException { } @ Override public TopDocs search ( Query query , Filter filter , int n ) throws IOException { } } public static class ExplanationAsserter extends Collector { Query q ; IndexSearcher s ; String d ; boolean deep ; Scorer scorer ; private int base = 0 ; public ExplanationAsserter ( Query q , String defaultFieldName , IndexSearcher s ) { } public ExplanationAsserter ( Query q , String defaultFieldName , IndexSearcher s , boolean deep ) { } @ Override public void setScorer ( Scorer scorer ) throws IOException { } @ Override public void collect ( int doc ) throws IOException { } @ Override public void setNextReader ( AtomicReaderContext context ) { } @ Override public boolean acceptsDocsOutOfOrder ( ) { } } }

Fix:
return ( Math . max ( Math . abs ( f1 ) , Math . abs ( f2 ) ) ) * ( CheckHits . EXPLAIN_SCORE_TOLERANCE_DELTA ) ;