Add workarounds for a bug on hadItem function of hamcrest-core