Hello,
Has anybody written Hamcrest matchers that make use of Java 8 functional interfaces?
I'm thinking especially of the Function interface; the matcher would apply a mapping before matching.
This would be really useful for collections, like this:
List<Person> personList = getListofPersons();
assertThat(personList, mappedWith(Person::getFirstName, hasItem("Peter")));
That would match a Person in the List where getFirstName yields "Peter". (The mappedWith method supplies the mapping matcher)
Regards,
Janne