I suspect you need something like:
MatcherAssert.assertThat(map, Matchers.<Foo, String>hasKey());
This way you can specify the type of value to call the hasKey method. It looks ugly, though, and I'm a little surprised that type inference doesn't help you ...
source share