protected boolean overlap ( Pair < Integer , Integer > expected , Pair < Integer , Integer > actual ) { // // a1 then a2 // if (a2.getBegin() - a1.getEnd() > 0) // return Position.before; // // // a2 then a1 // if (a1.getBegin() - a2.getEnd() > 0) // return Position.after; // // // overlap // return Position.overlap; // if ( actual . getKey ( ) >= expected . getKey ( ) && actual . getValue ( ) <= expected . getValue ( ) ) { return true ; } return false ; // full overlap is too lenient // if (expected.getKey() < actual.getValue() // && actual.getKey() < expected.getValue()) { // return true; // } // return false; }
Here we do a lenient comparison