static IndexComponentFilter findBestComponentFilter(
            IndexType type,
            List<IndexComponentCandidate> candidates,
            QueryDataType converterType
    ) {
        // First look for equality filters, assuming that they are more selective than ranges
        IndexComponentFilter equalityComponentFilter = searchForEquality(candidates, converterType);
        if (equalityComponentFilter != null) {
            return equalityComponentFilter;
        }

        // Look for ranges filters
        return searchForRange(type, candidates, converterType);
    }
@Test
    public void when_twoRangeFilterPresentAndNoBetterChoiceAndSortedIndex_then_filtersAreCombined() {
        IndexComponentFilter bestFilter = IndexComponentFilterResolver.findBestComponentFilter(
                indexType, WITH_TWO_RANGES_AS_BEST_CANDIDATES, QUERY_DATA_TYPE
        );

        if (indexType == IndexType.SORTED) {
            assertTrue(bestFilter.getFilter() instanceof IndexRangeFilter);
            IndexRangeFilter resultFilter = (IndexRangeFilter) bestFilter.getFilter();
            IndexRangeFilter lowerBound = (IndexRangeFilter) LOWER_BOUND_RANGE_CANDIDATE.getFilter();
            IndexRangeFilter upperBound = (IndexRangeFilter) UPPER_BOUND_RANGE_CANDIDATE.getFilter();
            assertEquals(resultFilter.getFrom(), lowerBound.getFrom());
            assertEquals(resultFilter.isFromInclusive(), lowerBound.isFromInclusive());
            assertEquals(resultFilter.getTo(), upperBound.getTo());
            assertEquals(resultFilter.isToInclusive(), upperBound.isToInclusive());
        } else {
            assertNull(bestFilter);
        }
    }