FindResult (TextRange range) { for (int i = getOccurrences().size() - 1; i >= 0; --i) { FindResult occurrence = getOccurrences().get(i); if (occurrence.getEndOffset() <= range.getStartOffset()) { return occurrence; } } return null; }