I wanted to write a logic for matcher like matcher_1 AND matcher_2 OR matcher_3 and matcher_4 where matcher_i are just placeholder for hamcrest matchers.
I decided to write it using CombinableMatcher like this -
new CombinableMatcher<String>(matcher_1).and(matcher_2).or(matcher_3).and(matcher_4)
Now, the question is in which order matchers will be evaluated ?
Will it be ((((matcher_1) AND matcher_2) OR matcher_3) and matcher_4) or any other order like ((matcher_1 AND matcher_2) OR (matcher_3 and matcher_4)) ?
I'm wondering why you're concerned with the ordering of matchers? Ideally it shouldn't matter, since you also don't know how often a matcher will be called.
If you have issues at this level of detail, it might be best to write a custom matcher.