private boolean allFoundEntriesIntersectQueryInFind(final List<CRAIEntry> index, final int sequenceId, final int start, final int span) { int foundCount = 0; for (final CRAIEntry found : CRAIIndex.find(index, sequenceId, start, span)) { foundCount++; Assert.assertEquals(found.getSequenceId(), sequenceId); boolean intersects = false; for (int pos = Math.min(found.getAlignmentStart(), start); pos <= Math.max(found.getAlignmentStart() + found.getAlignmentSpan(), start + span); pos++) { if (pos >= found.getAlignmentStart() && pos >= start && pos <= found.getAlignmentStart() + found.getAlignmentSpan() && pos <= start + span) { intersects = true; break; } } if (!intersects) { return false; } } return foundCount > 0; }