hamcrest/JavaHamcrest — pull request #74 by kay (2014-11-16 16:05:36+00:00)
Title: Relative order

This PR is a feature I've wanted for some time that Kevin Pauli from the Hamcrest Developers mailing list suggested in April along with a patch. I've applied his patch to the codebase and ensured it all looks sensible. My only contribution to this is a couple test cases I felt were useful and inclusion in matchers.xml.

The matcher is similar to the IsIterableContainingInOrder matcher except it accepts a partial order ("relative order") between elements. Allowing you to match an actual collection of 1, 2, 3, 4, 5, 6, 7 with a specification of containsInRelativeOrder(2, 4, 6).