Class SolrMatchers


  • public class SolrMatchers
    extends Object
    A Utility class for extra Hamcrest Matcher implementations.

    These may be directly related to Solr, or be filling gaps that the default Hamcrest Matchers do not cover.

    • Constructor Detail

      • SolrMatchers

        public SolrMatchers()
    • Method Detail

      • subListMatches

        public static <T> org.hamcrest.Matcher<List<? extends T>> subListMatches​(int fromIndex,
                                                                                 int toIndex,
                                                                                 org.hamcrest.Matcher<? super List<? super T>> subListMatcher)
        Matches a segment of a list between two indices against a provided matcher, useful for checking ordered and unordered sub-sequences in a larger list
        Type Parameters:
        T - The type that the list being matched against will contain
        Parameters:
        fromIndex - starting index of the desired sub-list (inclusive)
        toIndex - ending index of the desired sub-list (exclusive)
        subListMatcher - matcher for the resulting sub-list
        Returns:
        a Matcher for the original super-list