I am trying to find a definitive answer to using Hamcrest matchers in non test code. I have done a bit of research, and have some contrasting quotes:
Hamcrest on Wikipedia:
Hamcrest is a framework that assists writing software tests in the Java programming language. [snip] These matchers have uses in unit testing frameworks such as JUnit 2 and jMock.
Hamcrest on Github:
Hamcrest is a library of matchers, which can be combined in to create flexible expressions of intent in tests.
Hamcrest on Google Code:
Note: Hamcrest it is not a testing library: it just happens that matchers are very useful for testing.
Personally, I associate Matchers with tests, so I tend to avoid using them outside of tests. That said though, I can see no limitations which would prevent them being used outside of a test scope.
Does this then come down to a personal preference?