hamcrest/JavaHamcrest — pull request #79 by bgertzfield (2014-12-04 19:16:04+00:00)
Title: New matcher HasConsecutiveItems

When implementing a library to test compiler command-line arguments in the form:

`-x foo -y -z bar`

I found I needed a Hamcrest matcher which would look for a consecutive
sequence of items anywhere inside a collection of items.

I was surprised that Hamcrest had matchers which:

1) Match if a collection includes a single item anywhere (`hasItem`)
2) Match if a collection includes multiple items anywhere (`hasItems`)
3) Match if a collection includes multiple items in order anywhere, consecutive or not (`containsInRelativeOrder`)
4) Match if a collection exactly matches another collection in order (`contains`)
5) Match if a collection exactly matches another collection in any order (`containsInAnyOrder`)

but not for a consecutive sequence of items anywhere inside the collection.

This implements such a matcher and adds tests. I borrowed the tests from `containsInRelativeOrder`,
so let me know if there are better tests I should include. I wasn't sure about the `WithValue` stuff
so I just copy-pasted it from that test.