boolean (SearchResults.Direction direction) { List<FindResult> occurrences = mySearchResults.getOccurrences(); FindResult cursor = mySearchResults.getCursor(); FindResult last = direction == SearchResults.Direction.UP ? ContainerUtil.getFirstItem(occurrences) : ContainerUtil.getLastItem(occurrences); return cursor == last; }